1
我有一个UIView子类,我想要50x50;当我加载它总是占用整个屏幕我该如何解决这个问题?如何使UIView子视图以编程方式固定大小
我有一个UIView子类,我想要50x50;当我加载它总是占用整个屏幕我该如何解决这个问题?如何使UIView子视图以编程方式固定大小
发布一些代码,将有助于我们帮助你,但这里是你如何设置任何UIView子类的框架:
// When creating the view...
UIView *yourView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
// or after having created the view...
yourView.frame = CGRectMake(0, 0, 50, 50);
// ... or
[yourView setFrame:CGRectMake(0, 0, 50, 50)];