zoukankan      html  css  js  c++  java
  • 更改AlertView背景

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

                                                            message: @"I'm a Chinese!"

                                                           delegate:nil 

                                                  cancelButtonTitle:@"Cancel" 

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

        [theAlert show];

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

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

        CGSize theSize = [theAlert frame].size;

        

        UIGraphicsBeginImageContext(theSize);    

        [theImage drawInRect:CGRectMake(55, theSize.width-10, theSize.height-20)]; //这个地方的大小要自己调整,以适应alertview的背景颜色的大小。

        theImage = UIGraphicsGetImageFromCurrentImageContext();    

        UIGraphicsEndImageContext();

        theAlert.layer.contents = (id)[theImage CGImage];
    做一个顶天立地的男子,并且自信,健康微笑的生活下去!
  • 相关阅读:
    Hive中将文件加载到数据库表失败解决办法
    Hive安装及配置
    Hadoop下MapReduce实现Pi值的计算
    CentOS下Hadoop运行环境搭建
    kettle案例实现
    假期周总结报告03
    假期周总结报告02
    假期周进度报告01
    阅读笔记6
    阅读笔记5
  • 原文地址:https://www.cnblogs.com/luoxiao1115/p/3041172.html
Copyright © 2011-2022 走看看