旋转设备时,我的应用程序出现问题。 tableView扩展到设备视图,导致它无法访问。设备旋转时调整tableView的大小
我怎样才能得到表来调整因此这将不会发生呢?
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
NSLog(@"Device is rotated sidewise");
myTable.delegate = self;
myTable.dataSource = self;
myTable.scrollEnabled = YES;
[self.view addSubview:myTable];
myTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 148, 320, 10)];
}
}
在编码xcode或objective-c时,我是一个完整的noob。我目前正在研究这个问题,所以请对你的答案保持友好。
谷歌'autolayout'或' viewresizing masks'在iOS中 – Shubhank