I am new in iOS. I have a View
on top (width 1 px height) and a UITableView
below the View
.
Now, The constraint leading and trailing of the View is 10
I have tried to set the Separator Inset for the TableView with value Left is 10 and Right is 10 but it not work well (the view width is not equal to TableView Separator width).
I want to set the width of the View
equal to the width of the UITableView Separator
.
What should I do to achieve it? Any help would be appreciated
Try this , You can set the separator inset in your custom tableviewCell class by adding the below method,
- (UIEdgeInsets)layoutMargins
{
return UIEdgeInsetsMake(0, 10, 0, 10);
}
Then set your view's leading and trailing constraints by 10px.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.