Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想用 UITableView 填充弹出框。弹出框的高度取决于设备的方向等。如何设置 UITableView 属性使其始终填充弹出框的可用大小,并在必要时垂直滚动?
@H2CO3 是正确的。
在您呈现弹出框时的操作中,执行以下操作:
mytableView.frame = myPopover.bounds;
这样,您的表格视图将匹配它所在的弹出框。
然后,当您希望它滚动时,请执行以下操作:
[self.tableView setScrollEnabled:YES];