The left is a screenshot on visionOS, and the fitting is a screenshot on iOS. A grey background signifies that the Cell is chosen.
As we will see from the screenshot, there may be some spacing across the Cell in visionOS in comparison with the iOS state.
I can ignore the spacing between the left and proper sides of the Cell, however the spacing between the highest and backside triggered some issues in my utility, so I needed to take away that spacing.
I appeared by the documentation for UITableView and searched on the Web, however discovered no related data.
This query originates from the open supply library: JSONPreview. You’ll be able to reproduce this drawback through the use of the pattern undertaking within the Demo
listing after cloning the undertaking.
Under are some key supply codes:
open class LineNumberTableView: UITableView {
public override init(body: CGRect, model: UITableView.Type) {
tremendous.init(body: body, model: model)
config()
}
public required init?(coder aDecoder: NSCoder) {
tremendous.init(coder: aDecoder)
config()
}
}
personal extension LineNumberTableView {
func config() {
bounces = false
delaysContentTouches = false
canCancelContentTouches = true
showsVerticalScrollIndicator = false
showsHorizontalScrollIndicator = false
contentInsetAdjustmentBehavior = .by no means
allowsMultipleSelection = true
estimatedRowHeight = 0
estimatedSectionFooterHeight = 0
estimatedSectionHeaderHeight = 0
#if !os(tvOS)
scrollsToTop = false
separatorStyle = .none
#endif
}
}
//
open lazy var lineNumberTableView = LineNumberTableView(body: .zero, model: .plain)
// MARK: - UITableViewDelegate
extension JSONPreview: UITableViewDelegate {
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return getLineHeight(at: indexPath.row)
}
}
// MARK: - UITableViewDataSource
extension JSONPreview: UITableViewDataSource {
public func tableView(_ tableView: UITableView, numberOfRowsInSection part: Int) -> Int {
return lineDataSource.rely
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.backgroundColor = .clear
cell.textLabel?.textual content = "(lineDataSource[indexPath.row])"
cell.textLabel?.textAlignment = .proper
cell.textLabel?.font = highlightStyle.lineFont
cell.textLabel?.textColor = highlightStyle.coloration.lineText
return cell
}
}
Hope this helps, thanks very a lot!