How to use Apple custom UITabBarItem images?
-
22-09-2019 - |
문제
Apple has provided an example the View Controller Programming Guide, for creating an UITabBarItem, like this:
- (id)init {
if (self = [super initWithNibName:@"MyViewController" bundle:nil]) {
self.title = @"My View Controller";
UIImage* anImage = [UIImage imageNamed:@"MyViewControllerImage.png"];
UITabBarItem* theItem = [[UITabBarItem alloc] initWithTitle:@"Home" image:anImage tag:0];
self.tabBarItem = theItem;
[theItem release];
}
return self;
}
However, I am a graphic-noob and want to use Apple's built in graphics for Tab Bar Items. How could I do that? Where is a list of the available icons and their names?
해결책
Use - (id)initWithTabBarSystemItem:(UITabBarSystemItem)systemItem tag:(NSInteger)tag
to create UITabBarItem.
For possible UITabBarSystemItem values look in UITabBarItem class reference, 'Constants' section.
제휴하지 않습니다 StackOverflow