在 storyboard 中 viewdidload 下
[self.view layouifneed] 后可以获取控件的frame,在 控制器关联 xib 中却不起作用
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
NSLog(@"--3-%f",_labTip.sc_width);
}
//控制器里面 获取真实frame
- (void)viewDidLayoutSubviews {
CGFloat width = _frequencyBgImage.frame.size.width;
CGFloat height = _frequencyBgImage.frame.size.height;
NSLog(@"width : %f height : %f ",width,height);
}
// view xib 里面获取真实frame
- (void)layoutSubviews {
[super layoutSubviews];
[_imvHead layoutIfNeeded];
_imvHead.layer.cornerRadius = _imvHead.sc_width/2;
_imvHead.layer.masksToBounds = true;
}