UISearchBar as Header View #146

Open
dirkvdb opened this Issue May 31, 2012 · 3 comments

Comments

Projects
None yet
2 participants
@dirkvdb

dirkvdb commented May 31, 2012

Hi,

I would like to add a UISearchBar as the GridView Header view which is not visible by default, only when the user scrolls the grid view down. I added the UISearchBar as Header view of the grid view and then call

self.gridView.contentOffset = CGPointMake(0, searchBar.frame.size.height);

in my ViewDidLoad, but somehow the offset is overridden by the grid view to be 0 again by the time it is on the screen.

What would be the best way to get a UISearchbar that behaves like one in TableView with UISearchDisplaycontroller?

Thanks

@kolinkrewinkel

This comment has been minimized.

Show comment
Hide comment
@kolinkrewinkel

kolinkrewinkel May 31, 2012

Owner

Try calling it in viewDidAppear, prefixed with an if statement that checks if it's 0 or not.

Sent from my iPhone

On May 31, 2012, at 12:01 PM, dirkvdbreply@reply.github.com wrote:

Hi,

I would like to add a UISearchBar as the GridView Header view which is not visible by default, only when the user scrolls the grid view down. I added the UISearchBar as Header view of the grid view and then call

self.gridView.contentOffset = CGPointMake(0, searchBar.frame.size.height);

in my ViewDidLoad, but somehow the offset is overridden by the grid view to be 0 again by the time it is on the screen.

What would be the best way to get a UISearchbar that behaves like one in TableView with UISearchDisplaycontroller?

Thanks


Reply to this email directly or view it on GitHub:
#146

Owner

kolinkrewinkel commented May 31, 2012

Try calling it in viewDidAppear, prefixed with an if statement that checks if it's 0 or not.

Sent from my iPhone

On May 31, 2012, at 12:01 PM, dirkvdbreply@reply.github.com wrote:

Hi,

I would like to add a UISearchBar as the GridView Header view which is not visible by default, only when the user scrolls the grid view down. I added the UISearchBar as Header view of the grid view and then call

self.gridView.contentOffset = CGPointMake(0, searchBar.frame.size.height);

in my ViewDidLoad, but somehow the offset is overridden by the grid view to be 0 again by the time it is on the screen.

What would be the best way to get a UISearchbar that behaves like one in TableView with UISearchDisplaycontroller?

Thanks


Reply to this email directly or view it on GitHub:
#146

@dirkvdb

This comment has been minimized.

Show comment
Hide comment
@dirkvdb

dirkvdb May 31, 2012

That does work but it is pretty ugly. It first shows the search bar and then you see it disappear, even with an animation it is kind of disturbing.

For my iPhone Interface I use a regular table view and there I can set the offset in the ViewDidLoad, is it possible to get the same behavior with the KKGridView?

dirkvdb commented May 31, 2012

That does work but it is pretty ugly. It first shows the search bar and then you see it disappear, even with an animation it is kind of disturbing.

For my iPhone Interface I use a regular table view and there I can set the offset in the ViewDidLoad, is it possible to get the same behavior with the KKGridView?

@kolinkrewinkel

This comment has been minimized.

Show comment
Hide comment
@kolinkrewinkel

kolinkrewinkel May 31, 2012

Owner

I'll look into what's causing it.

Sent from my iPhone

On May 31, 2012, at 12:23 PM, dirkvdbreply@reply.github.com wrote:

That does work but it is pretty ugly. It first shows the search bar and then you see it disappear, even with an animation it is kind of disturbing.

For my iPhone Interface I use a regular table view and there I can set the offset in the ViewDidLoad, is it possible to get the same behavior with the KKGridView?


Reply to this email directly or view it on GitHub:
#146 (comment)

Owner

kolinkrewinkel commented May 31, 2012

I'll look into what's causing it.

Sent from my iPhone

On May 31, 2012, at 12:23 PM, dirkvdbreply@reply.github.com wrote:

That does work but it is pretty ugly. It first shows the search bar and then you see it disappear, even with an animation it is kind of disturbing.

For my iPhone Interface I use a regular table view and there I can set the offset in the ViewDidLoad, is it possible to get the same behavior with the KKGridView?


Reply to this email directly or view it on GitHub:
#146 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment