I am using the xcode template to create a UITableView application using the UINavigationController.
I need to add a UIView (in a fixed position) between the UINavigationBar and UITableView. How to do it?
Thank.
You can do this by setting the UITableView property tableHeaderView.
tableHeaderView
Link to the UITableView Class
tableHeaderViewReturns the helper view displayed above the table.@property (non-atomic, save) UIView * tableHeaderViewDiscussion The default value is nil. Viewing the table title is different from the section title.Availability Available in iOS 2.0 and later.
Returns the helper view displayed above the table.
@property (non-atomic, save) UIView * tableHeaderView
Discussion The default value is nil. Viewing the table title is different from the section title.
Availability Available in iOS 2.0 and later.
UIView UITableView UIView, , x, y CGRectMake objective-c
CGRectMake
UITableview
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
1) , .
@property (, ) IBOutlet UIView * viewHeader;
Setp 2) viewDidLoad
[self.tableview setTableHeaderView: self.viewHeader];
!!!
iOS. . , .
This is all theory, I did not do what you want. So do not jerk against me;) This is a friendly offer.
[self.view insertSubview:yourNewView belowSubview:navigationController];