Calypso Kid
Aspiring developer
Profile
Posts: 734
Reg: Mar 09, 2012
Upstate New Yor...
17,740
10/07/17 11:35 AM (2 weeks ago)

Xcode 9 sizing problems?

Hi all.

I remade my app in BT4, Xcode 9. It compiles with just 2 deprications if I use the default iOS 8. I do notice however that there are some sizing issues in the simulator and on a live device. All of the rows and fonts are about 1/3 smaller than when using Xcode 8 and the same device. Also, all of the screen background images no longer fill the entire background and the image that I use when the app is refreshing no longer auto fills the screen. I see like 1 1/2 of the images when the screen refreshes.

Also, the nav bar fonts are a bit smaller and the back arrow is really HUGE.

This seems to be a global issue and not a particular plugin issue. Any thoughts?

Thanks in advance,

Dave
 
SmugWimp
Smugger than thou...
Profile
Posts: 6250
Reg: Nov 07, 2012
Tamuning, GU
80,750
like
10/07/17 07:30 PM (2 weeks ago)
It's been easier for me to make a copy and update my BT3 projects. That said, I'm compiling for iOS 10 (after curing numerous warnings and errors) but I don't see any difference in the appearance; When I get it to work, it looks the same way it always did.

Not sure if that helps or not, but it is what it is. I'm using xcode Version 9.0 (9A235)

Cheers!

-- Smug
 
Calypso Kid
Aspiring developer
Profile
Posts: 734
Reg: Mar 09, 2012
Upstate New Yor...
17,740
like
10/08/17 05:10 AM (2 weeks ago)
thanks Smug
 
tompos
Veteran developer
Profile
Posts: 76
Reg: Oct 19, 2013
Wrzburg
6,860
like
10/18/17 09:02 AM (5 days ago)
Hi Dave,

I just stumbled upon the same huge back arrow button (Xcode 9.0.1, BT4).

This shows up only when I choose one of the simulators (iOS 11), not on my iPhone (still iOS 10).

The back button is special because it is not generated from system resource like e. g., the refresh button (which scales correctly...):

UIBarButtonItem *theRefreshButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:appDelegate action:refreshAppData];


Instead, the back button is generated in BT_viewcontroller.m by

//use custom back button...
UIImage *imgBack = [UIImage imageNamed:@"bt_back.png"];
imgBack = [imgBack imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
[btnBack addTarget:self action:sel forControlEvents:UIControlEventTouchUpInside];
btnBack.bounds = CGRectMake( 0, 0, 20, 30);
[btnBack setImage:imgBack forState:UIControlStateNormal];
UIBarButtonItem *barBtnBack = [[UIBarButtonItem alloc] initWithCustomView:btnBack];

In https://stackoverflow.com/questions/46247451/ios-11-uibarbuttonitem-images-not-sizing I found a solution... If you add a corresponding snippet to the code in BT_viewController.m it should work...

UIImage *imgBack = [UIImage imageNamed:@"bt_back.png"];
imgBack = [imgBack imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
[btnBack addTarget:self action:sel forControlEvents:UIControlEventTouchUpInside];

if (@available(iOS 9, *)) {
[btnBack.widthAnchor constraintEqualToConstant: 20].active = YES;
[btnBack.heightAnchor constraintEqualToConstant: 30].active = YES;
}

[btnBack setImage:imgBack forState:UIControlStateNormal];
...

Best wishes
Thomas
 
Calypso Kid
Aspiring developer
Profile
Posts: 734
Reg: Mar 09, 2012
Upstate New Yor...
17,740
like
10/18/17 09:06 AM (5 days ago)
Nice! Thank you Thomas. I’ll give it a try tonight.

Appreciate the help!

Dave
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.