ios - fade a UITextView while scrolling uiscrollview -


I have a UIScrollView that contains UIImageviews that are programmatically wrapped inside the UIScrollViews created. Inside that main UIScrollView, I have a UITextView that will show the content in the image view accordingly, while scrolling between different uiimageviews I want to reduce alpha according to UITextView according to the position of the scrolled UIScrollView accordingly.
Example if the user is half way through the screwing process, while the UIEZetase runs from one group to another, the UTXViews should have alpha 0.5. Any ideas how can I get this result

  - (zero) scrollViewDidScroll: ( UIScrollView *) Scrollview {CGFloat offset = scrollView.contentOffset.x; // Here you will get offset value CGFloat value = offset / totalcontentsize; // textview use 'value' for alpha value setting)  

How can I just add logic?

Or you can use a category. Create a category on UIView that UIView + Looks

  @interface UIView (looks) - (zero) feedtel; @end @implementation UIView (looks) - (zero) fadeTail {// it does not get carried away under a bar of text, web view or similar CAGradientLayer * shield = [CAGradientLayer layer], // is probably used ; Gradient.frame = self.bounds; Gradient.colors = @ [[ID] [[UIColor whiteColor] CGColor], (ID) [[UIColor clear collar] CGColor]]; Gradient.startPoint = CGPointMake (0.5, 0.93); Gradient.endPoint = CGPEXMake (0.5, 1); [Self. Layer Setmask: Gradient]; } @end  

Example usage (in this case on a web view

  @property (strong) IBOutlet UIWebView * dossierBlock; - (zero) _fillMainArea {[Self_loadBookImage]; NSString * longHtml = CLOUD.caMeeting [@ "yourJsonTag"]; nullsafe (longHtml), [self.dossierBlock longHtml baseurl: zero]; [self.dossierBlock fadeTail];}  

You can make "Fadetop" accordingly accordingly.


Comments