2012-05-11 42 views

回答

0

你必須建立一個NSMutableArray的,並把它5的UIBarButtonItem,設置他們的屬性,如您需要,然後設置此數組中的ToolBarItems這樣的:

NSMutableArray *buttonsArray = [[NSMutableArray alloc] init]; 
UIBarButtonItem *myButton1=[[UIBarButtonItem alloc] style:UIBarButtonItemStylePlain target:self action:@selector(toolbarButtonPressed1:)]; 
[buttonsArray addObject:myButton1]; 
//here you set the other properties for your first button 

// and then you do the same for your other buttons 


[self setToolbarItems:buttonsArray animated:YES]; 

當然,你必須要有:)

之前聲明工具欄
相關問題