0
我是iPhone的初學者我已經在所有按鈕的大小相同的工具欄設置工作給予任何建議和源代碼如何在相同大小的工具欄中設置五個按鈕?
我是iPhone的初學者我已經在所有按鈕的大小相同的工具欄設置工作給予任何建議和源代碼如何在相同大小的工具欄中設置五個按鈕?
你必須建立一個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];
當然,你必須要有:)
之前聲明工具欄