bfeher / BFPaperTabBarController

iOS UITabBar (controller) inspired by Google's Paper Material Design.
MIT License
342 stars 46 forks source link

Bad title position on the iPhone X emulator #29

Closed sm-tester closed 6 years ago

sm-tester commented 6 years ago

Hi, thank you for great library!

I found following bug on the iPhone x emulator, look to screenshot:

screen shot 2017-11-14 at 9 21 23 am

Do you have any suggestions how to fix it?

Thank you in advance!

bfeher commented 6 years ago

Hi @boyfox !

When I run the command pod try BFPaperTabBarController and get the default app up and running it works how iPhone X specifications state that it should: screen shot 2017-11-14 at 18 00 36

Are you doing anything custom with this control or maybe some AutoLayout issues with the new Safe Zones?

sm-tester commented 6 years ago

HI @bfeher !, Sorry for later replying, i bought iphone x and checked again, same issuse:

iphonex_bug

I'm using CustomUITabBar class for setting fixed height:

-(CGSize)sizeThatFits:(CGSize)size {
    CGSize sizeThatFits = [super sizeThatFits:size];
    sizeThatFits.height = 54; // 54pt - design in iphone 6 plus

    return sizeThatFits;
}

and i'm using vector images such as pdf files for icons.

others devices works fine:

screen shot 2017-12-07 at 12 31 53 pm

Do you have any suggestion, i need increasing tab bar height just on Iphone X? can i get standart device tabbar height for checking?

bfeher commented 6 years ago

Hi @boyfox!

Hmm. This seems like an issue with the new Safe Areas. Have you enabled them in your app? It looks like the content of the bar itself is pushed up correctly with safe zones, but the background isn't.

I can't reproduce this so I can only guess. Do you get the same results if you use a standard UITabBarController?

sm-tester commented 6 years ago

Yes, @bfeher you are right, Safe area stayed turn off in my project. But i can't switch on it, because my deployment target is iOS 8.0 .

Do you have any suggestions to fix it?

bfeher commented 6 years ago

When I updated my apps I had a problem where the entire UITabBar was below the Safe Area. I adjusted the Autolayout property and it worked perfectly. However what is strange in your case is that only the background and icons are in the original position while the bar itself is correctly positioned. Perhaps some of your auto layout constraints within the bar need new values when on the iPhone X? (Since you support iOS 8 and can't use Safe Area, maybe you can check if you are on the iPhone X and push up your constraints which are probably set to zero, to the height of the safe area?)

sm-tester commented 6 years ago

ok @bfeher thank you for suggestions, you can close or remove this issue, because this is not a bug of library. Thank you for great library!

bfeher commented 6 years ago

@boyfox Sorry that I couldn't help more. If you find out that it is this library, or want me to look at some code, let me know :)

sm-tester commented 6 years ago

Thank you @bfeher, you are best programmer! I removed custom UITabBar and works fine. Also works if I will increasing custom ui tabbar height if device model iphone X.

bfeher commented 6 years ago

;) You are too kind. I'm glad you could solve it!