我已经通过编程定义了UITabBar
,但是如何在项目处于活动状态时设置自定义UITabBar
图标?为UITabBar设置活动图像
这里是我声明UITabBar
按钮的代码,但是如何在活动时设置自定义图像?
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(@"Free", @"Free");
self.tabBarItem.image = [UIImage imageNamed:@"Free.png"];
}
return self;
}
hello sir,它给出错误,选择器setbackgroundimage的uitabbaritem没有可见的接口。 –