How do i add a label outside of tableview/scrollview so it only shows when scrolling

StackOverflow https://stackoverflow.com/questions/22170812

  •  02-06-2023
  •  | 
  •  

The title explains my question pretty good. You may have seen apps with scroll to reload text. I want something similar but instead there is a label that says "last updated". Is there anyway to do this?

没有正确的解决方案

其他提示

You can detect when your are scrolling with delegate methods of your UIScrollViewDelegate like scrollViewDidEndDragging:willDecelerate: and scrollViewDidEndDecelerating:

Add your label in your xib in the place you want and set alpha property to 1.0 when detect you are scrolling and alpha property to 0.0 when stop it.

You should have a XIB with a structure like this:

ViewController
-------------
  View
  -------------
    UIScrollview or UITableView
  -------------
    UILabel

Your label must be subview of your view and no of your scrollview and to be always in front of your uiscrollview

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top