1

How to make a SearchBar Controller hide itself when the view is loaded and then appears when a button is pressed before disappearing again when you scroll upwards. Snapping the search function right up and concealing it until the button is pressed again.

I'm using storyboard to create this, am I doing it correctly?

Am I doing this right? I've looked up tutorials and they all point to adding the Searchbar to a TableHeaderView. I wonder is there a TableHeaderview when the TableView is set to static.

Thanks a lot guys

Mukesh Ram
  • 6,248
  • 4
  • 19
  • 37
Ler Ws
  • 317
  • 5
  • 17

3 Answers3

0

This may not be what you're looking for but this will work.

In your viewdidload:

YourTextFied.alpha = 0.0

Change YourTextField to the name of your outlet and that will hide the code when the view loads.

When the button is pressed simply run the code:

YourTextField.alpha = 1.0

key9060
  • 75
  • 2
  • 10
0

you can use view.hidden = true before the view get loaded and then view.hidden = false when button get pressed

shelly
  • 9
  • 1
0

Nevermind, I found a really good guide here to animate a searchbar at the navigation bar when the search button is pressed.

How to animate add UISearchBar on top of UINavigationBar

thanks!

Community
  • 1
  • 1
Ler Ws
  • 317
  • 5
  • 17