分享

IOS7学习之路九ios7自定义UIAlertView

 叹落花 2015-05-13

IOS7的UIAlertView 不支持自定义,无法添加subview .

不过可以用第三方库git上的下载链接 https://github.com/wimagguc/ios-custom-alertview

Custom iOS7 AlertView

 

使用方法:

1.下载

2下载之后解压后把其中的

 

  • CustomIOS7AlertView.h
  • CustomIOS7AlertView.m 两个文件粘贴到自己的项目中。

     

    3.添加头文件

     

    在需要使用UIAlertView的地方,添加头文件。

    #import "CustomIOS7AlertView.h"

    并且添加协议。<CustomIOS7AlertViewDelegate> 4.添加AlertView

     

     

     

    1.CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] init];
    2.[alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"取消",@"确定", nil]];//添加按钮
    3.[alertView setContainerView:youcontroller.view];
    4.[alertView show];

     

    运行结果截图:

    \

     

    很简单就不做具体介绍了,大家可以下载Demo看看:http://download.csdn.net/detail/superlele123/6986895

    点击右上角Item弹出AlertView.

     

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多