Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main_0.29] Cherry-pick: New method for separator hiding (#2068) #2070

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ios/FluentUI/Other Cells/ActionsCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ open class ActionsCell: UITableViewCell, TokenizedControlInternal {
verticalSeparator.frame = CGRect(x: left, y: 0, width: verticalSeparator.frame.width, height: frame.height)
}

// A hacky way to hide the system separator by squeezing it just enough to have zero width.
// This is the only known way to hide the separator without making the UITableView do it for us.
let boundsWidth = bounds.width
let targetSystemSeparatorInset = UIEdgeInsets(top: 0, left: boundsWidth, bottom: 0, right: 0)
if separatorInset.left < boundsWidth {
separatorInset = targetSystemSeparatorInset
}

layoutHorizontalSeparator(topSeparator, with: topSeparatorType, at: 0)
layoutHorizontalSeparator(bottomSeparator, with: bottomSeparatorType, at: frame.height - bottomSeparator.frame.height)
}
Expand Down
8 changes: 8 additions & 0 deletions ios/FluentUI/Table View/TableViewCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,14 @@ open class TableViewCell: UITableViewCell, TokenizedControlInternal {
layoutContentSubviews()
contentView.flipSubviewsForRTL()

// A hacky way to hide the system separator by squeezing it just enough to have zero width.
// This is the only known way to hide the separator without making the UITableView do it for us.
let boundsWidth = bounds.width
let targetSystemSeparatorInset = UIEdgeInsets(top: 0, left: boundsWidth, bottom: 0, right: 0)
if separatorInset.left < boundsWidth {
separatorInset = targetSystemSeparatorInset
}

layoutSeparator(topSeparator, with: topSeparatorType, at: 0)
layoutSeparator(bottomSeparator, with: bottomSeparatorType, at: frame.height - bottomSeparator.frame.height)
}
Expand Down
Loading