Is there a way to fade text at the bottom and top when there is more data to be scrolled through in the UIScrollView? Would I have to put something on top of the UILabel I have in the UIScrollView in order to get that effect?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
You can easily fade views in and out using Core Animation. See the Animations section of the View Programming Guide for iOS for an idea of what you can easily animate. There's even an example (Listing 4-1) of animating the alpha property.
You can add an ImageView as a subview for scroll view with an transparent png in it.
I tried implementing Deepak's suggestion in Swift.
I think it would be like this,
The problem with this is that I see some delay in the gradient updates, so it's not completely smooth.
You can use a
CAGradientLayer
on both top and bottom. You can add/remove this in the delegate methodscrollViewDidScroll:
based on the scroll view'scontentOffset
.