Saturday, January 11, 2014

tableView dropdown search bar appears, small problems

Water faithful Well, ask tableView how to achieve the drop-down search bar appears it? In such an absolute statement posted to the sub-
Reply:
UIRefreshControl
Reply:
I write, less so that, I hope to give you some inspiration.
- (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath
{
static NSString * cellId = @ "cellid";
UILabel * label = nil;
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: cellId];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: cellId] autorelease];
label = [[UILabel alloc] initWithFrame: CGRectMake (20, 0, 100, 30)];
label.tag = 999;
label.backgroundColor = [UIColor redColor];
label.hidden = YES;
[Self.view addSubview: label];
} Else {
! flage = flage;
UILabel * label = (UILabel *) [self.view viewWithTag: 999];

if (flage) {
label.hidden = NO;
} Else {
label.hidden = YES;
}

}


/ / Cell.textLabel.text = [self.listData objectAtIndex: [indexPath row]];

return cell;


Reply:
Adding UISearchBar as UITableView UITableView's headerView to go

Reply:
 
_searchBar = [[PBSearchBar alloc] initWithFrame: CGRectMake (0, 0, self.view.bounds.size.width, 44.0f)];
_searchBar.placeholder = NSLocalizedString (@ "Please enter route name", @ "Please click on the name of the input line");
_searchBar.delegate = self;
[Self.view addSubview: _searchBar];

_tableView = [[PBListTableView alloc] initWithFrame: CGRectMake (0, 50, self.view.bounds.size.width, self.view.bounds.size.height - 50.0)];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableHeaderView = _searchBar;
[Self.view addSubview: _tableView];


The tableHeaderView set the UITableView UISearchBar instance on the line.
Reply:
https://github.com/fabiankr/TableViewSearchBar
Reply:
Dropdown search bar appears, pull-hide?

No comments:

Post a Comment