- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
#pragma mark – table view data source methods
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row == selectedRow && selected) {
return 130;
}else {
return 50;
}
}
bool selected=NO;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
selected = !selected;
selectedRow = indexPath.row;
[agendaTableView reloadData];
}
- (IBAction)return:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
@end
本文介绍了一个iOS应用如何实现仅支持竖屏显示,并详细展示了如何为UITableView设置不同的行高度,以及当选择某一行时如何改变其高度并刷新表格视图的方法。
1325

被折叠的 条评论
为什么被折叠?



