Hide UISearchBar in UITableView with multiple lines

The known solutions for hiding the UISearchBar do not work if the table contains only a few rows. For example,

 [self.companiesAndContatsTableView setContentOffset:CGPointMake(0, 44)];

      

will only work if the number of cells in the table exceeds the number of rows that fit on the screen. I want to hide the search bar in every situation - especially when the table contains only a few rows and the user doesn't need search functionality.

I tried to add something like:

self.companiesAndContatsTableView.contentInset = UIEdgeInsetsMake(-44, 0,0, 0);

      

but I am not allowed to move my alphabet index position from the right side.

enter image description here

+3
ios objective-c uitableview


source to share


No one has answered this question yet

See similar questions:

23
How can we hide tableHeaderView and tableFooterView?
1
Hide UISearchbar as title inside UITableview when canceled

or similar:

1473
Using Auto Layout in UITableView for Dynamic Cell Layouts and Variable Row Heights
1172
How can I disable the selection of a UITableView?
639
Eliminate extra separators below UITableView
613
iOS 8 UITableView separator inset 0 not working
208
How to disable scrolling in UITableView table when content is on screen
one hundred
How to hide the title of the first section in a UITableView (grouped style)
47
Determine if the table cell is visible.
13
UISearchBar at the top of the UITableView which can hide but stay close to the UINavigationBar
1
Is it possible to hide the rows of a UITableView but not the search bar?
0
contentOffset without many items in the UITableView



All Articles
Loading...
X
Show
Funny
Dev
Pics