做了一个iPhone项目。我想要通过点击按钮加载一个UIView,充填一半屏幕。
UIView *customView =[UIView alloc]initWithFrame:CGRectMake(10,100,200,200);//Give frame according to your view
customView.backgroundColor=[UIColor greenColor];
[Self.view addSubView: customView];
可以用addSubView试试。