У меня проблема с моим приложением при вращении устройства. TableView расширяет представление устройств, что делает его недоступным.Изменение размера таблицыView при повороте устройства
Как я могу заставить таблицу изменить размер, чтобы этого не произошло?
- (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)];
}
}
Я полный noob, когда дело доходит до кодирования с помощью xcode или object-c. В настоящее время я изучаю это, поэтому, пожалуйста, будьте дружелюбны к вашим ответам.
Google 'autolayout' или' viewresizing masks' в iOS – Shubhank