【发布时间】:2011-09-09 09:02:06
【问题描述】:
我需要在我的 tableView 中创建两个 UISearchBar。我希望它们在桌子顶部的宽度相等(并排)。
我已经为它们创建了两个 UISearchBar 出口,以及属性和 de alloc。我发现很难将它们都放在视图中(我的意思是合适的)。我只有一个搜索栏扩展到屏幕的整个宽度。我如何适合两个?
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 4, 45)];
zipSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(4, 0, 4, 45)];
searchBar.placeholder = @"School Name";
zipSearchBar.placeholder=@"Zip";
searchBar.delegate = self;
zipSearchBar.delegate = self;
self.tableView.tableHeaderView= zipSearchBar;
self.tableView.tableHeaderView= searchBar;
searchBar.autocorrectionType = UITextAutocorrectionTypeNo;
【问题讨论】:
标签: iphone objective-c xcode ios tableview