你怎么隐藏UIToolbar?

时间:2012-01-20 21:27:51

标签: ipad sdk ios5 xcode4.2

我在工具栏中有2个按钮。有没有办法隐藏工具栏,仍然显示2个按钮?这是到目前为止:

  UIBarButtonItem *cameraButton = [[UIBarButtonItem alloc] 
                                 initWithTitle:@"Camera"
                                 style:UIBarButtonItemStyleBordered
                                 target:self
                                 action:@selector(useCamera:)];
 /*    UIBarButtonItem *cameraRollButton = [[UIBarButtonItem alloc] 
                                     initWithTitle:@"Camera Roll"
                                     style:UIBarButtonItemStyleBordered
                                     target:self
                                     action:@selector(useCameraRoll:)]; */

NSArray *items = [NSArray arrayWithObjects: cameraButton,
                 /* cameraRollButton*/ nil];
[toolbar setItems:items animated:YES];

1 个答案:

答案 0 :(得分:1)

问题不是很具体。您可以从超级视图中删除工具栏。您可以将其不透明度设置为零。您可以在屏幕外设置其框架。你可以为后两者制作动画。

相关问题