Search code examples
iphoneiosuisplitview

add subView in master view on UISplitView


I wants to add a subview (like google paging) in masterView of UISplitView, I simply add a subview but the subview also scroll with masterView tableView, how i fix that subView not scroll with tableView? May be I am going in wrong track, please direct me on right way, how I add subview in masterView of UISplitView.

thanks

- (void)viewDidLoad
{
[super viewDidLoad];


UIView *barView=[[UIView alloc]initWithFrame:CGRectMake(0, 500, 300,50)];
barView.backgroundColor=[UIColor redColor];
[self.view addSubview:barView];
}

Solution

  • UITableView is a subclass of UIScrollView, so if your master view controller's main view is a table, any subviews are of course going to scroll. The solution is to create a view that will contain both the table and your barView. A plain old UIView will work fine for that.