刷新Tabbar(Tabbar图标标签)

时间:2012-06-16 19:34:26

标签: ios xcode uitabbarcontroller uilabel uitabbar

我切换第一个tabbaricon的标签名,如下所示:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {

   NSString *temp = [[NSUserDefaults standardUserDefaults] stringForKey:@"stateOfSwitch"];
    if ([temp isEqualToString:@"OFF"]) {
        self.title = NSLocalizedString(@"TabButtonOFF", nil);
    }
    else {

    self.title = NSLocalizedString(@"TabButton1", nil);

    }
        self.tabBarItem.image = [UIImage imageNamed:@"first"];


}
return self;
}

它可以通过启动和停止应用程序正常工作,但有没有办法刷新(重新加载)标签名? 到运行时?

0 个答案:

没有答案