swift - TableView 单元格分隔线未延伸到整个单元格

标签 swift interface-builder xcode6

我正在开发一个新项目,并为 UI 使用了 Storyboard。我所有的 tableViews 都有行分隔符的问题。下图显示了两条线。第一个是在属性检查器中设置的蓝色。第二个是黑色的,添加了我放在单元格中的 imageView。该线确实延伸到单元格的右侧,但没有延伸到左侧。有什么想法吗?

Blue separator line does not extend all the way to the left side of the cell.

最佳答案

首先设置表格 View
1.将tableview实例的separatorInset设置为UIEdgeInsetsMake(0, 0, 0, 0)
第二组单元格
1.set preservesSuperviewLayoutMargins of cell (instance) to NO
2.设置cell的layoutMargins为UIEdgeInsetsZero
3.saet separatorInset of cell to UIEdgeInsetsZero

希望能帮到你

关于swift - TableView 单元格分隔线未延伸到整个单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28655167/

相关文章:

uiviewcontroller - 如何使 UIViewController 工具栏出现?

ios8 - UIDatepicker 显示前一天

ios - 在 TextField iOS 中按退格键/删除键

ios - 如何在 Swift 中对绘图进行动画处理,同时更改 UIImageView 比例?

xml - Alamofire .post 在 Swift 中。 "Result of call is unused, but produces ' 数据请求'

iphone - 当重写 initWithCoder 时,总是需要调用 [super initWithCoder : coder]

ios - 如何在Xcode 5.1.1中安装iPhone 6和iPhone 6 Plus Simulator?

swift - 如何获取使用 ALAssetsLibrary 保存的照片的 url?

ios - 从 Swift 函数中的异步调用返回数据

ios - 如何在使用 swift 注册后将用户的位置存储到 firebase 数据库中?