【发布时间】:2011-11-25 04:41:48
【问题描述】:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return YES;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[self positionViews];
}
-(void)positionViews {
UIInterfaceOrientation destOrientation = self.interfaceOrientation;
if (destOrientation == UIInterfaceOrientationPortrait ||
destOrientation == UIInterfaceOrientationPortraitUpsideDown) {
[bLabel setFrame:CGRectMake(255, 10, 270, 60)];
} else {
[bLabel setFrame:CGRectMake(377, 10, 270, 60)];
}
}
bLabel 是自定义对象。
当 iPad(设备) 旋转时,bLable 会旋转。
但出现时间滞后。
所以旋转运动不流畅。
我的代码有什么问题? 如何在没有 IB 的情况下自然控制对象的自动调整大小?
请告诉我你的建议。谢谢!!!
【问题讨论】:
标签: ios ios5 custom-controls rotation autosize