2011-01-12 2 views

ответ

1

Это довольно прямолинейно, если вы посмотрите на документы, предложенные @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; 
Смежные вопросы