简体   繁体   English

TableView ReparatorInset宽度-没有情节提要的Swift 4

[英]TableView ReparatorInset Width - Swift 4 Without Storyboard

I'm trying to design an app with the width of the separatorInset being short. 我正在尝试设计一个带有短的spacerInset宽度的应用程序。 I can achieve that but the label in the cell gets short also. 我可以实现,但是单元中的标签也很短。

tableView.separatorInset = UIEdgeInsets(top: 0, left: 205, bottom: 0, right: 10)

Is it possble to target the actual separatorInset only and not to width of the row? 它是possble目标实际separatorInset而并非为了宽行的? The label should not be affected. 标签不应该受到影响。 I only need to shorten the separator . 我只需要缩短separator

Result expected: 预期结果:

在此处输入图片说明

最好的选择是使用自定义单元格,并使用高度为1px的UIView作为分隔符。

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

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