简体   繁体   English

如何将UITableview与iPhone 5的屏幕尺寸相匹配?

[英]How to fit UITableview with iPhone 5 screen size?

I have tried the solution from image in this post . 我在这篇文章中尝试过图像解决方案。 However, it only works when the screen is first loaded, when the app goes back to that screen again from the screen's child, it goes back to cut off tableview. 但是,它仅在首次加载屏幕时才有效,当应用程序再次从屏幕的子项返回到该屏幕时,它会返回切断tableview。

After I NSLog the tableview height in viewWillAppear: 在NSW中查看viewWillAppear中的tableview高度后:

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

Is there anything I miss? 有什么我想念的吗?

I also tried to add 我也尝试添加

tableResult.autoresizingMask &= ~UIViewAutoresizingFlexibleBottomMargin;

and

tableResult.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleHeight ;

but none of them works. 但它们都不起作用。

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

tableResult.autoresizingMask = UIViewAutoresizingFlexibleHeight;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM