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
    
  • 相关阅读:
    Python简介
    名词术语 1
    TypeError: 'method' object is not subscriptable 一般是函数没加括号导致的
    MYSQL 使用命令行导入文本数据 csv数据
    日期函数格式化
    日期函数——第几天、第几周、星期几、第几季度
    日期函数——MYSQL
    集合常见面试题
    输入一个随机整数,输出对应的大写
    Oracle数据库基本sql语句
  • 原文地址:https://www.cnblogs.com/0515offer/p/4638821.html
Copyright © 2011-2022 走看看