2011-06-09 36 views

回答

2

创建一个UIView并在视图上删除UIImageUITextView(或UILabel)。然后将视图添加到toolbarbutton。

0

要为您的工具栏按钮有一个图像和文本(我认为这是您的问题) 我创建一个tabBarItem属性,并在“setup”方法中分配init。在awakeFromNib中我调用了“setup”方法。一定有您在您的支持文件,用你的图像文件夹 这是我要做的事:

@interface YourViewController : UIViewController { 

} 
@property (retain) UITabBarItem *tabBarItem; 
-(void)setup; 
@end 

@implementation YourViewController 
@synthesize tabBarItem; 

-(void) setup{ 
UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"theTitleYouWant" image:[UIImage imageNamed:@"yourImage.png"] tag:0]; 
self.tabBarItem = item; 
[item release]; 
} 
@end 
相关问题