iOS6和iOS7可升级/UIButton之间有区别吗?

iOS6和iOS7可升级/UIButton之间有区别吗?,ios7,ios6,uibutton,uilabel,cgrect,Ios7,Ios6,Uibutton,Uilabel,Cgrect,我试图将UIButton放在多行UILabel旁边。下面是我的代码 //ans is Multiline UILabel NSString * btnTitle = @"Button Title"; UIButton *button = [self linkButtonWithTitle:btnTitle targetAction:@selector(buttonPressed)]; CGSize stringSize = [btnTitle sizeWithFont:[UIFont fontW

我试图将UIButton放在多行UILabel旁边。下面是我的代码

//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];

所以我面临的问题是iOS6和iOS7上的按钮位置不同。iOS6似乎正确,但iOS7在y轴上偏离了几个点。我注意到iOS6上的UILabel间距比iOS7上的大。iOS6和iOS7上的UILabel/UIButton框架实现之间有什么区别吗?

我不知道,但是为了确保您的应用程序可以在屏幕宽度和高度中接收到这些内容,并将它们分开,以将标签和按钮放置在正确的位置

在ios7中,状态栏中的导航栏是透明的。所以检查一下

这篇文章可能会有帮助