开发者

Is there a possibility to add button in UITabBar in IPad?

开发者 https://www.devze.com 2023-02-04 19:25 出处:网络
I wa开发者_Go百科nt to know if it is possible to add an UIButton in UITabBar on the iPad. If so, please let me know.this is fairly straight forward if you look at the docs suggested by @Kyle the Unrul

I wa开发者_Go百科nt to know if it is possible to add an UIButton in UITabBar on the iPad. If so, please let me know.


this is fairly straight forward if you look at the docs suggested by @Kyle the Unruly.

Here's an example of adding a built in button and your own image:

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消