TPKeyboardAvoiding icon indicating copy to clipboard operation
TPKeyboardAvoiding copied to clipboard

In iOS 7 the ScrollView avoids the status bar

Open Megatron1000 opened this issue 11 years ago • 14 comments

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.

Megatron1000 avatar Sep 12 '13 13:09 Megatron1000

This is affecting me too :X

Wirsing84 avatar Sep 30 '13 17:09 Wirsing84

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.

Megatron1000 avatar Sep 30 '13 19:09 Megatron1000

Well that property (automaticallyAdjustScrollViewInsets) is quite important in iOS 7 - so this is not a viable solution

Wirsing84 avatar Sep 30 '13 19:09 Wirsing84

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.

Megatron1000 avatar Sep 30 '13 21:09 Megatron1000

didn't work for me

thepelican avatar Oct 18 '13 03:10 thepelican

This is affecting me too... Any work around? I try your solution @Megatron1000 but didn't work for me too.

xiaodoudou avatar Oct 18 '13 12:10 xiaodoudou

@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).

Jack-s avatar Oct 18 '13 13:10 Jack-s

@Megatron1000's solution worked for me. Hoping to pull a more stable solution though..

nessalauren5 avatar Oct 23 '13 02:10 nessalauren5

Could somebody create/adapt a sample project to demonstrate this? Then I'll take a look.

michaeltyson avatar Oct 23 '13 02:10 michaeltyson

This is what I'm using in my viewController for anyone not using IB:

if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) { self.automaticallyAdjustsScrollViewInsets = NO; }

christian-smith avatar Nov 09 '13 06:11 christian-smith

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.

pablolic avatar Nov 27 '13 11:11 pablolic

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 avatar Dec 04 '13 08:12 xiaodoudou

@xiaodoudou, thanks! I had same problem and changing kCalculatedContentPadding value to '0' resolves issue with offset by Y after hiding keyboard.

freemansion avatar Oct 25 '14 14:10 freemansion

static const CGFloat kCalculatedContentPadding = 0; works!

patelnitesh avatar Apr 16 '15 13:04 patelnitesh