UI5_UIAlertView与UIActionSheet】的更多相关文章

// // ViewController.h // UI5_UIAlertView与UIActionSheet // // Created by zhangxueming on 15/7/7. // Copyright (c) 2015年 zhangxueming. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController <UIAlertViewDelegat…
// 创建弹框 从底部弹出,一般用于危险操作 UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"恭喜通关" delegate:nil cancelButtonTitle:@"取消" destructiveButtonTitle:@"确定" otherButtonTitles:@"其他", nil]; [sheet showInView:self.view…
- (void)viewDidLoad {    [super viewDidLoad];        UISwitch *swc = [[UISwitch alloc] initWithFrame:CGRectMake(40, 100, 295, 30)];    [swc addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged];    [self.vi…
一,效果图. 二,代码. RootViewController.m //点击任何处出现sheet -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UIActionSheet * sheet = [[UIActionSheet alloc] initWithTitle:@"确定要清空图片缓存?" delegate:self cancelButtonTitle:@"取消" destruc…
UIAlertView 提示用户  帮助用户选择框 //    UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:@"警告" message:@"你还没把信息填完" delegate:nil  cancelButtonTitle:@"cancle" otherButtonTitles:@"确认",  nil]; //    [alterView show];…
1.效果图:分别为有短信分享                                      无短信分享 -(void)viewDidLoad{ //添加按钮 UIButton *shareButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 100, 100, 50)]; [shareButton setBackgroundColor:[UIColor redColor]]; [shareButton addTarget:s…
UIActionSheet是在iOS弹出的选择按钮项,可以添加多项,并为每项添加点击事件. 为了快速完成这例子,我们打开Xcode 4.3.2, 先建立一个single view application.然后再xib文件添加一个button,用来弹出sheet view. 1.首先在.h文件中实现协议 加代码的地方在@interface那行的最后添加<UIActionSheetDelegate>,协议相当于java里的接口,实现协议里的方法. @interface sheetviewViewC…
一.UIAlertView. UIActionSheet都是ios系统自带的弹出式对话框,当UIAlertView或UIActionSheet弹出来时用户无法与应用界面中的其它控件交互,UIAlertView与AUIctionSheet最大的区别在于UIAlertView是表现为显示在屏幕中央的弹出式警告框,而 ActionSheet表现为显示在屏幕底部的按钮列表. 1.创建UIAlertView.创建该对象时可致定改警告框的标题.消息内容.以及该警告框包含几个按钮等信息.如果程序需要监听用户点…
//首先必须继承协议 @interface TRViewController : UIViewController<UIAlertViewDelegate,UIActionSheetDelegate> //UIAlertView功能实现 - (IBAction)clicked:(id)sender { UIButton *btn = sender; //设置tag值 if (btn.tag==0) { UIAlertView *alertView = [[UIAlertView alloc]i…
-(void)willPresentActionSheet:(UIActionSheet *)actionSheet { SEL selector = NSSelectorFromString(@"_alertController"); if ([actionSheet respondsToSelector:selector])//ios8 { UIAlertController *alertController = [actionSheet valueForKey:@"_a…