XCODE 4.5にアップグレードして以来、この問題に直面しています。
さまざまなUI要素があります
UIButton *button1;
UIButton *button2;
UIButton *button3;
- (void)viewDidLoad
{
button1 =[[UIButton alloc]init ];
button1.backgroundColor=[UIColor yellowColor];
[self.view addSubview:button1];
button2 =[[UIButton alloc]init ];
button2.backgroundColor=[UIColor yellowColor];
[self.view addSubview:button2];
button3 =[[UIButton alloc]init ];
button3.backgroundColor=[UIColor yellowColor];
[self.view addSubview:button3];
}
フレームが宣言されている
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation==UIInterfaceOrientationPortrait ||[interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown )
{
button1.frame=CGRectMake(10,10,10,10);
button2.frame=CGRectMake(10,30,10,10);
button3.frame=CGRectMake(10,50,10,10);
}
if(interfaceOrientation ==UIInterfaceOrientationLandscapeLeft ||interfaceOrientation==UIInterfaceOrientationLandscapeRight)
{
button1.frame=CGRectMake(20,10,10,10);
button2.frame=CGRectMake(20,30,10,10);
button3.frame=CGRectMake(20,50,10,10);
}
return YES;
}
ただし、フレームは Xcode 4.5 では設定されていません。以前のバージョンでは正常に機能していました。
アプリで自動サイズ調整がひどく必要です。だから私を助けて。