动态更新帧不起作用

时间:2014-04-25 18:47:08

标签: ios uiview frame

我试图在出现键盘时调整视图的框架

更改此视图的帧大小高度似乎不会更改帧大小

CGRect frame = self.bounds;
    frame.origin = CGPointMake(0, 0);
    frame = UIEdgeInsetsInsetRect(frame, UIEdgeInsetsMake(CGRectGetHeight(self.tableHeaderView.frame), 0, 0, 0));
    frame.size.height -= self.contentInset.top;
    frame.size.height -= 300;
    view.frame = frame;
    view.translatesAutoresizingMaskIntoConstraints = YES;
    view.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);

问题是,当我将新帧应用于视图时 view.frame = frame;

视图的框架实际上没有改变

0 个答案:

没有答案