UIView半透明上的按钮不可见

UIView半透明上的按钮不可见,uiview,uibutton,subview,alpha,Uiview,Uibutton,Subview,Alpha,我有一个UIView,其中一些部分是半透明的(alpha尝试用以下方式设置UIView半透明度: myView.backgroundColor=[UIColor colorWithRed:0.1f绿色:.1f蓝色:.1f阿尔法:.7f] 设置alpha值 -(void)viewDidLoad{ //...... self.viewSito = [[UIView alloc]init]; //this view has some parts semi-trasparent and ot

我有一个UIView,其中一些部分是半透明的(alpha尝试用以下方式设置UIView半透明度:

myView.backgroundColor=[UIColor colorWithRed:0.1f绿色:.1f蓝色:.1f阿尔法:.7f]

设置alpha值

-(void)viewDidLoad{
  //......
  self.viewSito = [[UIView alloc]init];
  //this view has some parts semi-trasparent and other opaque

  self.buttonClose =[UIButton buttonWithType:UIButtonTypeRoundedRect];
  self.buttonClose.backgroundColor=[UIColor blackColor];
  self.buttonClose.alpha =1.0;
 /*the output is semi-transparent when is on uiview semi-transparent, but when uiview is 
  opaque the button is not visible, as if it were "hidden" from the opaque part 
  of the view.*/
  //...

 [self.viewSito addSubview:self.buttonClose];

}