IdleHandsApps / IHKeyboardAvoiding

IHKeyboardAvoiding is an elegant solution for keeping any UIView visible when the keyboard is being shown - no UIScrollView required!
MIT License
1.41k stars 150 forks source link

Status bar overlapping #39

Closed happiehappie closed 6 years ago

happiehappie commented 6 years ago

I have the following screen, blue background being the container view and my avoiding view.

simulator screen shot - iphone se - 2017-09-21 at 00 40 28 However, when I present my keyboard, the container view overlaps with my status bar. simulator screen shot - iphone se - 2017-09-21 at 00 40 30 Was wondering if there's any way to dodge this? My self.view.clipsToBounds is already set to true if that matters

fraserscottmorrison commented 6 years ago

Im guessing you don't want the black view to go off the top of the screen?

Id put another UIView inside the blue view, then add the textfield and button to this new UIView. The new UIView can be your avoiding view.

happiehappie commented 6 years ago

But then won't the "another UIView" overlap with the black view?

happiehappie commented 6 years ago

Or is this the expected behavior?

fraserscottmorrison commented 6 years ago

Depends what you want. I'd add a constraints between the black view and the new view so that they can't overlap (e.g. min constraint height = 8)

But depending on the size of the device you might not be able to fit everything on the screen. You might need to lower the priority of a constraint (e.g. black view top or height constraint) so that it'll move off the top or shrink if needed

fraserscottmorrison commented 6 years ago

Got it sorted?