0

I am trying to put UIButton right next to multiline UILabel. Following is my code,

//ans is Multiline UILabel
NSString * btnTitle = @"Button Title";
UIButton *button = [self linkButtonWithTitle:btnTitle targetAction:@selector(buttonPressed)];
CGSize stringSize = [btnTitle sizeWithFont:[UIFont fontWithName:HELVETICA_NEUE_REGULAR_FONT size:10.f]];
button.frame = CGRectMake(ans.frame.origin.x + 54, ans.frame.origin.y + 28, stringSize.width, stringSize.height);
[self button];

So the issue I am facing is the button position is different on iOS6 and iOS7. iOS6 seems to correct but iOS7 is off by few points on y axis. The thing I noticed is that on iOS6 UILabel spacing is larger compared to one on iOS7. Is there any difference between UILabel/UIButton Frame implementations on iOS6 and iOS7 ?

Brodie
  • 429
  • 1
  • 5
  • 16
slonkar
  • 4,055
  • 8
  • 39
  • 63

2 Answers2

0

Not that I know of, however to be sure you code against this your app can receive in the screen width and height and divide out to place your labels and buttons in the correct spot.

Caleb
  • 1
  • This post might help http://stackoverflow.com/questions/4779221/in-iphone-app-how-to-detect-the-screen-resolution-of-the-device – Caleb Jul 13 '14 at 03:26
0

In ios7 navigation bar in status bar is transparent. So check for that.

Sandeep
  • 766
  • 5
  • 16