本人新人 刚接触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];
}
}
}
这个并没有修改按钮的字体颜色,请教各位大大 代码需要在修改才能达到效果
-(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];
}
}
}
这个并没有修改按钮的字体颜色,请教各位大大 代码需要在修改才能达到效果
UIButton *tempButton=(UIButton *) tempView;
[tempButton setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
}
这个方法或许以前是可以用的,记得好像修改很多控件以前都是可以用的,不过ios7之后似乎用不成了,用其他方法代替吧