2014-07-10 38 views
0

我想把UIButton放在多行UILabel的旁邊。以下是我的代碼,iOS6和iOS7 UILable/UIButton有區別嗎?

//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 Frame實現是否有區別?

回答

0

不是我所知道的,但是要確保您對此代碼進行編碼,您的應用程序可以在屏幕寬度和高度上進行分割,並將標籤和按鈕分割到正確的位置。

+0

這篇文章可能會有所幫助http://stackoverflow.com/questions/4779221/in-iphone-app-how-to-detect-the-screen-resolution-of-the-device – Caleb

0

在狀態欄中的ios7導航欄是透明的。所以檢查一下。