自定义一个uiview需要实现什么函数
1 回答
慕森卡
TA贡献1806条经验 获得超8个赞
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MyView" owner:self options:nil];
UIView *tempMyView = [nib objectAtIndex:0];
CGRect tempFrame = [[UIScreen mainScreen] bounds];
[tempMyView setCenter:CGPointMake(tempFrame.size.width/2, tempFrame.size.height/2)];
[self.view addSubview:tempMyView];
}
- 1 回答
- 0 关注
- 720 浏览
添加回答
举报
0/150
提交
取消