TPKeyboardAvoiding
TPKeyboardAvoiding copied to clipboard
In iOS 7 the ScrollView avoids the status bar
If the view is set to take up the whole screen, now that the status bar in iOS 7 encroaches on the view area, the scrollview is unavoidably lowered by 20 pixels, clipping the bottom 20 pixels of the view.
This is affecting me too :X
I've figured out how to fix it. In Interface Builder, under the attributes inspector, the viewcontroller has a property called 'adjust scroll view insets' you need to untick.
Well that property (automaticallyAdjustScrollViewInsets) is quite important in iOS 7 - so this is not a viable solution
Ok, well it worked in my case as I'm just setting it on a single view controller so doesn't have a knock on effect for anything else I'm doing. I thought the setting was just to assist with the transparent navigation bars though.
didn't work for me
This is affecting me too... Any work around? I try your solution @Megatron1000 but didn't work for me too.
@xiaodoudou @xiaodoudou You can try unchecking the "Under Top Bars" option under "Extend Edges" (obviously this isn't ideal and I wouldn't consider that a "solution", but that should work for the moment).
@Megatron1000's solution worked for me. Hoping to pull a more stable solution though..
Could somebody create/adapt a sample project to demonstrate this? Then I'll take a look.
This is what I'm using in my viewController for anyone not using IB:
if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) { self.automaticallyAdjustsScrollViewInsets = NO; }
TPKeyboardAvoiding was moving the scroll view down before the screen was presented to the user, it was showing a 1 cm white space horizontal strip between the navigation bar at the top of the screen and the top of the first text field. @Megatron1000's solution worked for me. Hoping to pull a more stable solution though.
Regarding this issue I solved it by changing "kCalculatedContentPadding" to 0. I don't know if its a big issue, but regarding my app it's seems to working well.
@xiaodoudou, thanks! I had same problem and changing kCalculatedContentPadding value to '0' resolves issue with offset by Y after hiding keyboard.
static const CGFloat kCalculatedContentPadding = 0; works!