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
  •  | 
  •  

Domanda

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?

Nessuna soluzione corretta

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top