Now I'm trying to make my app compatible for iPhone 6/6+. The issue is, I have 4 buttons horizontally aligned in one row. The width of each of them is 80 points(set in the storyboard). It's fine for iPhone4/5/5s. Now when I simulated the app on iPhone 6/6+, you can see there's 2 pixels space between the 3rd and 4th buttons. I'm not using auto layout. I know the width of iPhone 6 plus is: 1242 x 2208px. The problem is 1242 cannot be divided by 4.
The issue is when I use following code:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
CGFloat screenScale = [[UIScreen mainScreen] scale];
CGSize screenSize = CGSizeMake(screenBounds.size.width * screenScale, screenBounds.size.height * screenScale);
CGFloat screenWidth = screenSize.width;
Actually the screenWidth
is 640.
Anybody know how to sort out this problem? Many thanks in advance.