博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

UIAlertView FontColors and Font

Posted on 2013-01-30 13:55  酸梅拯救地球  阅读(353)  评论(0)    收藏  举报

1.

-(void)willPresentAlertView:(UIAlertView *)a;ertView{
UILabel *title = [alertView valurForKey:@"_titleLabel"];
title.font = [UIFont fontWithName:@"Arial" size:18];
[title setTextColor:[UIColor whiteColor];

UILabel *body = [alertView valueForKey:@"_bodyTextLabel"];
body.font = [UIFont fontWithName:@"Arial" size:15];
[body setTextColor:[UIColor whiteColor];
}

2.

- (IBAction)showBigAlert:(id)sender {

     UIAlertView* find = [[UIAlertView allocinitWithTitle:@"big size view" message:@"do you see it" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nilnil];

    //[find setDelegate:self];

    /*

    UIAlertView *find = [[UIAlertView alloc] initWithFrame:CGRectMake(5, 20, 320,700)];

    find.title=@"big size view" ;

    find.message=@"some message";

     */

    [find show];

    [find release];

    

}

//- (void)willPresentAlertView:(UIAlertView *)alertView

-(void)willPresentAlertView:(UIAlertView *)alertView {

    [alertView setFrame:CGRectMake(1201000600)]; 

    forUIView * view in alertView.subviews )

    {

        if( [view isKindOfClass:[UILabel class]] )

        {

            UILabel* label = (UILabel*) view;

            label.textAlignment = UITextAlignmentLeft;

            label.font=[UIFont fontWithName:@"STHeitiSC-Medium" size:18];

            label.textColor=[UIColor greenColor];

            

        }

if ( [view isKindOfClass:[UIButton class]] )

    }

}