IOS7学习之路九(ios7自定义UIAlertView)

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

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

Custom iOS7 AlertView

使用方法:github

1.下载spa

2下载以后解压后把其中的.net

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


3.添加头文件code

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

#import "CustomIOS7AlertView.h"ip

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

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

运行结果截图:get



很简单就不作具体介绍了,你们能够下载Demo看看:http://download.csdn.net/detail/superlele123/6986895it

点击右上角Item弹出AlertView.

相关文章
相关标签/搜索