关于objective c全局变量的使用
backView.frame=CGRectMake(100,300,120,120);backView.backgroundColor=[UIColorblackColo...
backView.frame=CGRectMake(100, 300, 120, 120);
backView.backgroundColor=[UIColor blackColor];
backView.autoresizesSubviews = YES;
[self.window addSubview:backView];
UIView *topView =[[UIView alloc] init];
topView.frame = CGRectMake(10, 10, 100, 100);
topView.backgroundColor = [UIColor orangeColor];
topView.autoresizingMask =UIViewAutoresizingFlexibleWidth;
[backView addSubview:topView];
将backview定义在implementation下为全局变量后,在ios模拟器上没有显示这两个视图 展开
backView.backgroundColor=[UIColor blackColor];
backView.autoresizesSubviews = YES;
[self.window addSubview:backView];
UIView *topView =[[UIView alloc] init];
topView.frame = CGRectMake(10, 10, 100, 100);
topView.backgroundColor = [UIColor orangeColor];
topView.autoresizingMask =UIViewAutoresizingFlexibleWidth;
[backView addSubview:topView];
将backview定义在implementation下为全局变量后,在ios模拟器上没有显示这两个视图 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询