0

i have a UITableView having custom UITableViewCell. it has UITextField. in order to avoid hiding of UITextField below the keyboard, i wrote a custom method to move up the View when text field is under keyboard.

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.25f];
[UIView setAnimationBeginsFromCurrentState:YES];
CGRect frame = self.view.frame;
if (up) {
    if (frame.origin.y >= 0) {
        frame.origin.y = frame.origin.y - 120;
    }
} else {
    if (frame.origin.y >= -150) {
        frame.origin.y = frame.origin.y + 120;
    }

}
[self.view setFrame:frame];
[UIView commitAnimations];

this works fine and the table view is going up and down according to my requirements in ios 6.

But in ios 7 when the view is up, the tableview is shown above status bar. As an alternate i tried setting content inset for tableview and scrolling to row at position. But it was not up to my requirement. Please suggest a method to hide tableview above status bar.

Salman Zaidi
  • 9,342
  • 12
  • 44
  • 61
Akshay
  • 73
  • 2
  • 16

4 Answers4

1

So I pretty much assume you are using previous iOS 6 style status bar. In iOS 6 when you move your view upward, it takes care of status bar and view does not come over status bar. But in iOS 7 although you show status bar in iOS 6 style, you can't let your views go under status bar when you move you view upward.

See this post for more detail

and also have a look at iOS 7 UI Transition Guide.

Community
  • 1
  • 1
Salman Zaidi
  • 9,342
  • 12
  • 44
  • 61
1

try in your viewcontroller in viewDidLoad:

self.edgesForExtendedLayout = UIRectEdgeNone;
Birdy
  • 355
  • 1
  • 5
  • 15
1

I had a similar problem on iOS 8 when set on my UITableView clipsToBounds = NO Setting back to YES did the trick.

Andrey Solovyov
  • 551
  • 7
  • 21
0

ios 7 has +20 Pixles than ios 6.

check

Adds Bar showing up form Bottom in ios 7

Community
  • 1
  • 1
Pravin
  • 44
  • 9