zoukankan      html  css  js  c++  java
  • Change background color of a UIAlertView

    UIAlertView *theAlert = [[[UIAlertView alloc] initWithTitle:@"Atention"

    message: @"I'm a Chinese!"

      delegate:nil 

      cancelButtonTitle:@"Cancel" 

      otherButtonTitles:@"Okay",nil] autorelease];

    [theAlert show];

    /*

    for(UIView *view in [theAlert subviews]){

    if(view.tag ==1){

    view.backgroundColor = [UIColor greenColor];

    }

    }

    */

    UIImage *theImage = [UIImage imageNamed:@"loveChina.png"];    

    theImage = [theImage stretchableImageWithLeftCapWidth:0. topCapHeight:0.];

    CGSize theSize = [theAlert frame].size;

    UIGraphicsBeginImageContext(theSize);    

    [theImage drawInRect:CGRectMake(0, 0, theSize.width, theSize.height)];    

    theImage = UIGraphicsGetImageFromCurrentImageContext();    

    UIGraphicsEndImageContext();

    theAlert.layer.contents = (id)[theImage CGImage];

  • 相关阅读:
    stl测试
    noip2017逛公园
    比赛
    莫队算法
    noi.ac 第五场第六场
    重排DL
    bzoj2870
    异象石(就是sdio宝藏那题)
    Genius ACM
    模板复习
  • 原文地址:https://www.cnblogs.com/javawebsoa/p/2458494.html
Copyright © 2011-2022 走看看