-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Edge-to-edge cell separator / margin bug with picker rows #438
Comments
I have never tried to change the cell margin yet. |
That's "TextRow"...sorry, my mistake when typing up the code. I'm trying to get this look: What happens when I use the commonly referenced ways of accomplishing this is that not all the rows conform to the zero inset margin. Ideally I would want to retain the actual text margins from left/right as they are by default in Eureka, and ONLY extend the cell separator so that it spans the entire width of the screen. |
Try using this code... override func viewDidLoad() {
super.viewDidLoad()
tableView?.separatorInset = UIEdgeInsetsZero // Add this line on each FormViewController
// ...
}
// The following code should be executed before loading any form view controller.
// It will set up layout properties for the whole app. Missing rows/custom rows types should be added.
// I tested it against Eureka example app and it works like a charm.
TextRow.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.contentView.preservesSuperviewLayoutMargins = false
cell.contentView.layoutMargins.left = 50
}
ButtonRow.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.indentationLevel = 5
}
SwitchRow.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.indentationLevel = 5
}
DateTimeInlineRow.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.indentationLevel = 5
}
DateRow.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.indentationLevel = 5
}
DateTimeRow.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.indentationLevel = 5
}
PickerInlineRow<NSDate>.defaultCellSetup = { cell, row in
cell.preservesSuperviewLayoutMargins = false
cell.layoutMargins.left = 0
cell.indentationLevel = 5
} As you may have seen, Let me know if this works. |
Thanks, I wasn't able to get the Date/Picker rows to allow zero margins with any combination of properties on the cell/contentview, etc. So what I did was approximate what the gap is on the left (~15px) and set all the other cells to use that for the left/right margins. I think it looks better anyway, because it gives it a slight indentation underneath the header/section. End result is that I have edge-to-edge separators and I maintained the default padding on left/right. :) 👍 One issue: How to adjust margin for footer now? Because all footer text starts at the very left edge. Padding is gone. |
Headers and footers are managed by UIKit if you use a simple string. If you use custo =m views then you should be able to align it to your rows. Anyway we have fixed some misalignments since this issue was opened. I will close this issue. If any new issue arises please open a new one. |
When setting up code to allow for edge-to-edge separators, any picker rows (date, generic, etc.) do not conform to the newly set rules.
Example below:
Edit: Is there any way to preserve actual text margins and ONLY make the separator line edge-to-edge? I've tried every imaginable combination of settings on the tableView and cell itself, but I can't get it to work right.
The text was updated successfully, but these errors were encountered: