ユーザーが iPhone 5 を使用している場合、カスタム ボタンのサイズを大きくしたいと考えています。
これは私の.mファイルにあるものです
//.m File
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
int varWidth = 228;
}
if(result.height == 568)
{
int varWidth = 272;
}
}
....
[newButton setFrame:CGRectMake(8.0, 40.0, 228, 80.0)];
しかし、私はこのようなものが欲しい:
[newButton setFrame:CGRectMake(8.0, 40.0, varWidth, 80.0)];