Grouped UITableview remove outer separator line

前端 未结 19 2235
遇见更好的自我
遇见更好的自我 2020-12-02 10:58

I have a grouped UITableview which is created programatically. Also I have a cell with xib file populated in tableview programmatically as well. So far so good. But I want t

19条回答
  •  情书的邮戳
    2020-12-02 11:33

    This is what I finally came up with:

    I was not able to find some better way than this. But it is working for me greatly. Last tried with Xcode Version 7.3.1 (7D1014). This procedure was done through storyboard.

    Basically I add a UIView of 0.5 pt Height on the UITableViewCell and then set a background color for that UIView. Set parent UITableView's Separator as None.

    Here is the details:

    Considering you already set your UITableViewCell, custom or default. On the very first stage set the UITableView's separator as None.

    Next add a UIView of 1 pt Height and set the Background as you need, on my case it is Red.

    Start setting the constraints. The problem is to set the height of the UIView as 0.5 pt. This is the only Problematic issue for this workflow.

    UIView with 0.5 pt Height:

    Sharing the way to set 0.5 pt height of the UIView.

    First(1) pin the view and then(2) set the height as 0.5. Press Enter.

    Finally your UIView will look similar like following.

    I was not able to set the height as 0.5 other than this way.

提交回复
热议问题