2018-03-20

iOS Xib 加载View frame布局无效


- (instancetype)initWithFrame:(CGRect)frame

{

    self = [super initWithFrame:frame];

    if (self) {

        self = [[[NSBundle mainBundle] loadNibNamed:@"OrderDetailView" owner:nil options:nil] lastObject];

//在初始化方法里设置view的frame 之后会产生效果

        self.frame = CGRectMake(0, 0,frame.size.width,frame.size.height);

    }

    return self;

}

你可能感兴趣的:(2018-03-20)