Accessing View in awakeFromNib?

前端 未结 5 611
醉话见心
醉话见心 2020-12-08 08:48

I have been trying to set a UIImageView background color (see below) in awakeFromNib

[imageView setBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alp         


        
5条回答
  •  Happy的楠姐
    2020-12-08 09:20

    In case you're using a UIView subclass instead of a UIViewController subclass, you can override loadView method:

    - (void)loadView
    {
        [super loadView];
        //IBOutlets are not nil here.
    }
    

提交回复
热议问题