viewcontroller能显示全屏的一半吗
1个回答
展开全部
- (void)viewDidLoad
{
[superviewDidLoad];
UIScrollView *tempScroll = [[UIScrollViewalloc]initWithFrame:CGRectMake(0,64,320, 200)];
[tempScrollsetBackgroundColor:[UIColor grayColor]];
[tempScroll setContentSize:CGSizeMake(self.view.bounds.size.width,self.view.bounds.size.height)];
[self.view addSubview:tempScroll];
UIButton*tempButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[tempButtonsetBackgroundColor:[UIColor redColor]];
[tempButton setTitle:@"subView A"forState:UIControlStateNormal];
[tempButtonsetFrame:CGRectMake(80,0,80, 100)];
NSLog(@"%d",tempScroll.subviews.count);
[tempScrolladdSubview:tempButton];
}
{
[superviewDidLoad];
UIScrollView *tempScroll = [[UIScrollViewalloc]initWithFrame:CGRectMake(0,64,320, 200)];
[tempScrollsetBackgroundColor:[UIColor grayColor]];
[tempScroll setContentSize:CGSizeMake(self.view.bounds.size.width,self.view.bounds.size.height)];
[self.view addSubview:tempScroll];
UIButton*tempButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[tempButtonsetBackgroundColor:[UIColor redColor]];
[tempButton setTitle:@"subView A"forState:UIControlStateNormal];
[tempButtonsetFrame:CGRectMake(80,0,80, 100)];
NSLog(@"%d",tempScroll.subviews.count);
[tempScrolladdSubview:tempButton];
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询