遍历父视图上的button

 for (UIView * thebtn in [self.view subviews])
 {    
     if ([thebtn isKindOfClass:[UIButton class]]) 
        {     //***改变字体颜色                
            [(UIButton *)thebtn setTitleColor:[UIColor redColor]     forState:UIControlStateNormal]; 
            //***改变背景                
         [(UIButton *)thebtn setBackgroundImage:nil forState:UIControlStateNormal];                 
   }              
 } 

 

posted @ 2013-12-16 14:43  菜鸟程序猿  阅读(336)  评论(0编辑  收藏  举报