UILabel UIButton 混合问题
问题描述
1 左边是UILabel,右边是UIButton
2 UI没有给出左右边距及label、button长度
问题解决
1 创建UIView 包含两个控件
//registerView
UIView *registerView = [[UIView alloc] initWithFrame:CGRectZero];
registerView.frame = CGRectMake((parentView.viewWidth - registerLabel.viewWidth - registerButton.viewWidth) / 2,
viewY, registerButton.viewWidth+registerLabel.viewWidth, registerLabel.viewHeight);
2 使用sizeToFit 测量控件长宽
//registerLabel
UIL