zoukankan      html  css  js  c++  java
  • UI6_UIAlertContrller

    //
    //  ViewController.m
    //  UI6_UIAlertContrller
    //
    //  Created by zhangxueming on 15/7/7.
    //  Copyright (c) 2015年 zhangxueming. All rights reserved.
    //
    
    #import "ViewController.h"
    
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
        //NSLog(@"屏幕被触摸");
    //    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"提示" message:@"电量不足%10" preferredStyle:UIAlertControllerStyleAlert];
    //    
    //    [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
    //        NSLog(@"取消");
    //    }]];
    //    
    //    [alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
    //        NSLog(@"确定");
    //    }]];
    //    
    //    [self presentViewController:alertController animated:YES completion:nil];
        
        
        UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"分享" message:@"分享" preferredStyle:UIAlertControllerStyleActionSheet];
        [actionSheet addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
        [actionSheet addAction:[UIAlertAction actionWithTitle:@"新浪微博" style:UIAlertActionStyleDefault handler:nil]];
        [actionSheet addAction:[UIAlertAction actionWithTitle:@"QQ" style:UIAlertActionStyleDestructive handler:nil]];
        
        [self presentViewController:actionSheet animated:YES completion:nil];
    }
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        
        
    }
    
    - (void)didReceiveMemoryWarning {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    }
    
    @end
    
  • 相关阅读:
    骑士飞行棋第二版(已完善)
    骑士飞行棋第一版(掷骰子方法分开)
    do -while语句的使用
    随机数例子(Random)
    Day6_time模块
    Day6_正则表达式
    Day6_内置函数
    centos6-7克隆主机网卡无法启动问题
    rsync+innotify做到同步式更新
    apache压力测试工具的apache bench和JMeter的安装
  • 原文地址:https://www.cnblogs.com/0515offer/p/4638821.html
Copyright © 2011-2022 走看看