u014794736
dominghao
采纳率33.3%
2017-07-20 15:47 阅读 632

ViewController里是如何调用tabBarItem这个属性的?

30
 //头文件
 #import <UIKit/UIKit.h>

@interface BNRHypnosisViewController : UIViewController

@end

//实现文件
#import "BNRHypnosisViewController.h"
#import "BNRHypnosisView.h"

@implementation BNRHypnosisViewController

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

        // Set the tab bar item's title
        self.tabBarItem.title = @"Hypnotize";

        UIImage *image = [UIImage imageNamed:@"Hypno.png"];
        self.tabBarItem.image = image;
    }

    return self;
}

在ViewController的接口文件里面并没有看到tabBarItem这个属性,
想请教:self.tabBarItem.image = image;是怎么调用的???

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐