What's the right way to add a ToolBar to a UITableView?

后端 未结 5 1074
情深已故
情深已故 2021-01-31 04:27

I\'m writing a Navigation-Based iPhone app, and I\'d like to have a UIToolBar docked at the bottom of my screen, with a UITableView scrolling between the tool bar and the naviga

5条回答
  •  -上瘾入骨i
    2021-01-31 04:54

    //Tool bar
    [self.navigationController setToolbarHidden:NO];
    
    UIBarButtonItem *buttonItem = [[ UIBarButtonItem alloc ] initWithTitle: @"Select All"
                                                    style: UIBarButtonItemStyleBordered
                                                   target: self
                                                   action: @selector(selectAll:) ];
    UIBarButtonItem *buttonNext = [[UIBarButtonItem alloc]initWithTitle:@"Next" style:UIBarButtonItemStyleBordered target:self action:@selector(goNext:)];
    self.toolbarItems = [ NSArray arrayWithObjects: buttonItem, buttonNext, nil ];
    
    [ buttonItem release ];
    [buttonNext release];
    

提交回复
热议问题