ios - 如何使 UITableview 与 iPhone 5 屏幕尺寸相匹配?

标签 ios uitableview iphone-5

我已经尝试了此 post 中图像的解决方案.但是,它仅在首次加载屏幕时才有效,当应用程序从屏幕的子级再次返回该屏幕时,它会返回以切断 tableview。

在我 NSLog viewWillAppear 中的 tableview 高度之后:

340.00 (tableview first loaded)
245.00 (tableview re-appeared)

有什么我想念的吗?

我也尝试添加
tableResult.autoresizingMask &= ~UIViewAutoresizingFlexibleBottomMargin;


tableResult.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleHeight ;

但它们都不起作用。

最佳答案

您应该将表格的高度设置为灵活:

tableResult.autoresizingMask = UIViewAutoresizingFlexibleHeight;

关于ios - 如何使 UITableview 与 iPhone 5 屏幕尺寸相匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16055932/

相关文章:

ios - 未调用 UISearchDisplayController 委托(delegate)方法

css - 如何调试 iphone 5 中的 css 问题(ui 问题)?

objective-c - 在越狱设备上使用 loadNibNamed 时可能会崩溃 [UIDeviceRGBColor superview] : unrecognized selector

iphone - UIImagePickerController 媒体类型 kUTTypeMovie 运行时异常

ios - CALayer frame.size 不等于 bounds.size

ios - 在 SceneKit 中使用 MPMoviePlayerController 作为纹理

ios - 导航 Controller 中 UIViewController 缺少后退按钮

ios - 防止 UITableViewCell 子类允许滑动删除?

objective-c - @ []在 objective-c 中代表什么?