我想在UIView中添加我的按钮,就像我可以隐藏或不是它们一样。在UIView中添加UIStuff
我的按钮的代码:
carte1J1=[UIButton buttonWithType:UIButtonTypeCustom];
carte1J1.tag=11;
carte1J1.frame=CGRectMake(60, 240, 50, 73.0);
[carte1J1 setImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",imagecarte1] ] forState:UIControlStateNormal] ;
[carte1J1 addTarget:self action:@selector (clicCarte1J1) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:carte1J1 atIndex:1];
我的看法是viewJoueur1,我尝试添加像这样的观点我的按钮。
[viewJoueur1 addSubview:carte1J1];
,并测试我试图隐藏viewJoueur1:
viewJoueur1.hidden=YES;
但按钮仍是可见的,我不明白为什么