Get rid of the line above a UITableView

I have a UITableView (which has a UISearchBar ) and it cannot figure out how to get rid of the white / gray border above it. I need to have a black color between the UISearchBar and the black above it.

I tried to hide the UISearchBar to see if this was related to this, but the line still appeared.

Any ideas?

Line

+2
source share
4 answers

This is due to the pullToRefresh view I used (using SensibleTableView) - it had some code in drawRect to draw a line.

+1
source

In my case, it helped to establish:

  searchBar.clipsToBounds = YES; 
+9
source

You must customize the UISearchBar background to meet your requirements. take a look at this tutorial.

+1
source

You should try this, with which you can set the color of the cell borders, and if you want to change the color of a specific cell border, put it in a state like: if (indexPath.row == yourcell):

 tableView.separatorColor = [UIColor blackColor]; 

You must also put the above method in the CellForRowAtIndexPath method for the table view data source.

Please let me know if it works.

+1
source

Source: https://habr.com/ru/post/1307850/


All Articles