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