zoukankan      html  css  js  c++  java
  • UIActionSheet用法


    //上拉菜单
    1
    UIActionSheet* sheet = [[UIActionSheet alloc] 2 initWithTitle:nil 3 delegate:self 4 cancelButtonTitle:@"取消" 5 destructiveButtonTitle:@"确定" 6 otherButtonTitles:@"拍照",@"选择本地照片",nil]; 7 [sheet showInView:self.view]; 8 9 (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex 10 { 11 if (buttonIndex == 0) { 12 [self showAlert:@"拍照"]; 13 }else if (buttonIndex == 1) { 14 [self showAlert:@"选择本地照片"]; 15 }else if(buttonIndex == 2) { 16 [self showAlert:@"取消"]; 17 }else if(buttonIndex == 3) { 18 [self showAlert:@"确定"]; 19 } 20 21 } 22 - (void)actionSheetCancel:(UIActionSheet *)actionSheet{ 23 24 } 25 -(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex{ 26 27 } 28 -(void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex{ 29 30 }

     

     1 [self showAlert:@"拍照"];
     2 
     3 //弹出对话框
     4 - (void)showAlert:(NSString *)message{
     5     UIAlertView *alertView = [[UIAlertView alloc]
     6                               initWithTitle:nil
     7                               message:message
     8                               delegate:self
     9                               cancelButtonTitle:@"Cancel"
    10                               otherButtonTitles:@"OK", nil];
    11     
    12     [alertView show];
    13 }

     

  • 相关阅读:
    Python环境的安装
    tar.xz如何解压:linux和windows下tar.xz解压命令介绍
    设置SVN忽略文件和目录(文件夹)
    C#【Thread】Interlocked 轻量级锁
    手把手教你做个AR涂涂乐
    理解UV贴图
    unity animation readonly 无法加事件?
    LUA Metatables
    增强现实阴影
    unity shader tags
  • 原文地址:https://www.cnblogs.com/wangshengl9263/p/3230662.html
Copyright © 2011-2022 走看看