0

I am developing an app in that I have used the search bar functionality to search some kind of data. It's working fine in iOS 6.

But when I run this app on iOS 7 my search field goes in status bar field.

Means overlaying it. Why this happening?

Help me out please.

Thanks in Advance.

Nayan
  • 3,014
  • 2
  • 17
  • 33
Jitendra
  • 5,055
  • 2
  • 22
  • 42
  • http://stackoverflow.com/questions/17074365/status-bar-and-navigation-bar-appear-over-my-views-bounds-in-ios-7/18785646#18785646 – LE SANG Dec 26 '13 at 09:53
  • Check also this answer: http://stackoverflow.com/questions/19121162/uisearchdisplaycontroller-on-ios7 – Andrea Dec 26 '13 at 10:14

3 Answers3

0

Hope it will help, add it into you viewDidLoad method

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f) {
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.edgesForExtendedLayout = UIRectEdgeNone;
}
KudoCC
  • 6,912
  • 1
  • 24
  • 53
0

In iOS7, your View size is full screen including the area behind Status bar. You need to modify your UI to support iOS7

You can set the iOS 6/7 delta values in Interface Builder to support iOS7 and iOS6 both.

See this : iOS 7 status bar back to iOS 6 default style in iPhone app?

Community
  • 1
  • 1
san
  • 3,350
  • 1
  • 28
  • 40
  • What have you tried? Can you show us please? I have done the same thing and it worked. – san Dec 26 '13 at 10:23
  • i have used storyboard in that i have drop search bar in storyboard... when i clicked on search bar it goes to top i dot want this... – Jitendra Dec 26 '13 at 10:25
0

This is very simple solution i have tried.

  if ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f)
    {

        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.navigationController.navigationBarHidden=YES;

    }
Jitendra
  • 5,055
  • 2
  • 22
  • 42