2
Я хочу знать, можно ли добавить UIButton
в UITabBar
на iPad. Если это так, пожалуйста, дайте мне знать.Есть ли возможность добавить кнопку в UITabBar в IPad?
Я хочу знать, можно ли добавить UIButton
в UITabBar
на iPad. Если это так, пожалуйста, дайте мне знать.Есть ли возможность добавить кнопку в UITabBar в IPad?
Это довольно прямолинейно, если вы посмотрите на документы, предложенные @Kyle 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;
вы смотрели в uibarbuttonitem http://developer.apple.com/library/ios/ipad/#documentation/uikit/ ссылка/UIBarButtonItem_Class/Справка/reference.html – Kyle