tag是UIView的一个属性,而且要求tag值唯一。父视图可以通过tag来找到一个子视图1 UIView *redView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.window. ...
tag是UIView的一个属性,而且要求tag值唯一。父视图可以通过tag来找到一个子视图
1 UIView *redView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.window.frame), CGRectGetHeight(self.window.frame)/2)];2 redView.backgroundColor = [UIColor redColor];3 redView.tag = 1000;4 [self.window addSubview:redView];5 6 UIView *getView = [self.window viewWithTag:1000];
原标题:IOS之UIView的tag学习
关键词:IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。