简体   繁体   English

xcode 6:autolayout中的tableview适用于某些设备但不是全部

[英]xcode 6 : tableview in autolayout is working for some devices but not all

I'm using auto layout to design tableview that uses f ull margins of the cells and it's working partially. 我正在使用自动布局设计tableview,它使用了单元格的边缘,并且它正在部分工作。

Also tableView separatorStyle is not working too 另外tableView separatorStyle也不起作用

class HomeTableViewController: UITableViewController {

override func viewDidLoad() {
    super.viewDidLoad()


    self.tableView.separatorStyle = UITableViewCellSeparatorStyle.None

在此输入图像描述

在此输入图像描述

First disable the features width any and height any of both the tableview and tableview cell. 首先禁用tableview和tableview单元格的任何宽度any和height。 click on pin for image view or view you are using as background of cell select all the constraint left,right,top & bottom.You are selecting left,top,bottom in image above you posted. 点击图片视图的图钉或查看您用作单元格的背景选择左,右,上,下的所有约束。您在上面的图像中选择左,上,下。 Deselect the height and width you are showing in image above. 取消选择您在上图中显示的高度和宽度。

If you want to place the text vew or label or etc in right of the table view then select left,right,top and only height. 如果要将文本vew或标签等放置在表格视图的右侧,请选择左,右,顶部和唯一的高度。 This would definately solve your problem. 这肯定会解决您的问题。 i am unable to post the image since i didnt have 10 reputation.Hope it will solve your problem. 我无法发布图像,因为我没有10个声誉。希望它能解决你的问题。

Now You can also follow these methods: 现在您还可以按照以下方法操作:

iOS - Custom table cell not full width of UITableView iOS - 自定义表格单元格不是UITableView的全宽度

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

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