你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> iosUIToolBar工具條的使用

iosUIToolBar工具條的使用

編輯:IOS開發綜合

很簡單:


-(void)viewWillAppear:(BOOL)animated

{

[superviewWillAppear:animated];

self.navigationController.toolbarHidden =NO;


}


- (void)viewDidLoad {

[superviewDidLoad];

// Do any additional setup after loading the view.

// self.navigationController.toolbarHidden = NO;

self.view.backgroundColor = [UIColorredColor];

UIBarButtonItem *one = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAddtarget:nilaction:nil];

UIBarButtonItem *two = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemBookmarkstarget:nilaction:nil];

UIBarButtonItem *three = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemActiontarget:nilaction:nil];

UIBarButtonItem *four = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdittarget:nilaction:nil];

UIBarButtonItem *flexItem = [[UIBarButtonItemalloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpacetarget:nilaction:nil];

[selfsetToolbarItems:[NSArrayarrayWithObjects:flexItem, one, flexItem, two, flexItem, three, flexItem, four, flexItem,nil]];

}


記住 不要在viewDidLoad裡面設置工具條不隱藏!
  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved