ios - tableviewcell 不会横向拉伸(stretch),即方向改变

标签 ios uitableview uiviewcontroller screen-rotation

我需要一个不会从 View 中消失的固定 header 。我打算在下面保留表格 View 的摘要。所以我从 UIViewController 开始,并尝试将 UIView 和 UITableView 放在它下面。

  1. 在 UIView 中,我添加了一个 UIButton、UILabel,但我遇到了布局限制。

  2. 在 UITableView 中,当我改变方向时,单元格没有填满 View 。这是为什么?我是ios编程的新手。感谢任何指点。

请看下面的图片。

enter image description here

enter image description here

最佳答案

看起来你没有用 superview 固定所有的 tableview 边缘,这就是发生这种情况的原因..

选择 tableview 并使用 superview 固定 tableview 的所有边缘,仅此而已..见下图

enter image description here

关于ios - tableviewcell 不会横向拉伸(stretch),即方向改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32535616/

相关文章:

ios - 如何获得 SKProduct 的本地货币 |在 Swift 中显示 IAP 价格

ios - iPhone模拟器图形损坏

swift - 在 Swift 中提取并转换为字符串

ios - IBOutlet for element in containerview inside original viewcontroller

iphone - 查找设备相机分辨率iOS的方法

ios - 使用自动布局模仿 UITableViewCellStyleValue1 accessoryType-detailTextLabel 间距?

ios - 对核心数据对象的更改未持久

ios - 无法访问 tableview 属性以获取在自定义单元格中单击的按钮的索引

iOS UITextViews 数据挥之不去,即使我清除了一个数组

ios - 在 TableView 单元格中显示 "loading bar"