#ipad #uibutton #uitabbar
#iPad #uibutton #uitabbar
Вопрос:
Я хочу знать, возможно ли добавить UIButton
in UITabBar
на iPad. Если да, пожалуйста, дайте мне знать.
Комментарии:
1. вы заглядывали в uibarbuttonitem developer.apple.com/library/ios/ipad/#documentation/uikit /…
Ответ №1:
это довольно просто, если вы посмотрите документы, предложенные @Kyle the Unruly.
Вот пример добавления встроенной кнопки и вашего собственного изображения:
UIBarButtonItem * viewSnapShotButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:self action:@selector(snapShotButtonPressed:)];
UIBarButtonItem * fontButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"Font.png"] style:UIBarButtonItemStylePlain target:self action: @selector(fontSize:)];
// Add buttons to the tab bar
NSMutableArray *topCentreItems = [[NSMutableArray alloc] init];
UITabBar *topCentreTabBar = [[UITabBar alloc] initWithFrame:CGRectMake(0, 0, 120, 75];
[topCentreItems addObject:viewSnapShotButton];
[topCentreItems addObject:fontButton];
topCentreTabBar.items = topCentreItems;