本人新人 刚接触IOS软件开发没多久 最近希望修改IOS alertView 中按钮的字体颜色为绿色 按照网上的 
-(void)willPresentAlertView:(UIAlertView *)alertView{
    for(UIView *tempView in alertView.subviews){
        if([tempView isKindOfClass:[UIButton class]]){
            UIButton *tempButton=(UIButton *) tempView;
            [tempButton setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
        }
    }

这个并没有修改按钮的字体颜色,请教各位大大 代码需要在修改才能达到效果

解决方案 »

  1.   

    我建议你使用第三方的alertView,或者告诉你们产品:在iOS上没有这么玩儿的
      

  2.   

     if([tempView isKindOfClass:[UIButton class]]){
                UIButton *tempButton=(UIButton *) tempView;
                [tempButton setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
            }
    这个方法或许以前是可以用的,记得好像修改很多控件以前都是可以用的,不过ios7之后似乎用不成了,用其他方法代替吧
      

  3.   

    实现UIAlertViewDelegate没有?
      

  4.   

    alertview这玩意儿,不如自己用block写个组件来的方便。
      

  5.   

    如果需求比较自定义话,最好自己写一个类似的alertview