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

后端 未结 5 1072
情深已故
情深已故 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条回答
  •  情歌与酒
    2021-01-31 05:07

    As of OS 3.0 the Navigation Controller has a tool bar built in. To make it appear:

    [self.navigationController setToolbarHidden:NO];
    

    By implmenting:

    - (void)setToolbarItems:(NSArray *)toolbarItems animated:(BOOL)animated
    

    in your view controller, you can configure the items of the tool bar.

    So you no longer have to worry about where the tool bar is located in your hierarchy.

    (corrected typo)

提交回复
热议问题