I created UITableView
in viewDidLoad
method like this:
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(25.0, 0.0, 277.0, 393.0) style:UITableViewStyleGrouped];
mySearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)];
[self.tableViewLists setTableHeaderView:mySearchBar];
CGRect newFrame = mySearchBar.frame;
newFrame.size.width = newFrame.size.width + 50.0f;
newFrame.origin.x = newFrame.origin.x - 25.0f;
mySearchBar.frame = newFrame;
[self.tableViewLists setTableHeaderView:mySearchBar];
And I want to add UISearchBar
for the UITableView
tableHeaderView
that will have this frame:
CGRectMake(0.0f, 0.0f, 320.0f, 44.0f)
After I set my UISearchBar
for UITableView tableHeaderView
, it's frame stretched for the UITableView's width. Can I somehow change frame for UISearchBar?