سؤال

Hei guys.

What I am trying to achieve is have my search bar behind the navigation controller just like in the sparrow app. So when you scroll down the search bar is basically part of the view.

The first picture is the view when it's first loaded. The second one is after I scrolled down. Do you know any way I can achieve this? I was thinking of having the search bar as part of the view and just load the view form the point that's just under the search bar. But I don't know how to do that. Any help would be much appreciated. Thanks.

هل كانت مفيدة؟

المحلول

I agree with @holex's comment if you're using a tableview. Seems silly to re-implement.

However, in the unlikely event you're not. You could just use a UIScrollView for your content and place the search bar at the top, and adjust the content offset accordingly. So it would appear as if the search bar has animated from under your navigation bar.

Here's a link to the UIScrolView class page on the dev site

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top