UIActionSheet的常用方法

enum UIActionSheetStyle : Int {

    case Automatic // take appearance from toolbar style otherwise uses ‘default‘
    case Default //默认风格:灰色背景上显示白色文字  
    case BlackTranslucent ////透明黑色背景,白色文字
    case BlackOpaque // //纯黑背景,白色文字  
}
//初始化,标题,代理,取消按钮,销毁按钮init(title: String?, delegate: UIActionSheetDelegate?, cancelButtonTitle: String?, destructiveButtonTitle: String?)

   unowned(unsafe) var delegate: UIActionSheetDelegate? 

  var title: String

//风格

var actionSheetStyle: UIActionSheetStyle

//添加按钮

func addButtonWithTitle(title: String) -> Int

// 返回 buttonIndex位置的按钮标题

func buttonTitleAtIndex(buttonIndex: Int) -> String

//获取有多个按钮

var numberOfButtons: Int { get }

//取消按钮的下标

var cancelButtonIndex: Int

//销毁按钮的下标

var destructiveButtonIndex: Int

//第一个其他按钮的下标

var firstOtherButtonIndex: Int { get }

var visible: Bool { get }

//showInview可能会导致弹出菜单被toolbar挡住,最下面的按钮不一定能接受的touch事件,showFromToolbar 是在toolbar上方弹出,就不会有这个问题 //在toolbar上面显示func showFromToolbar(view: UIToolbar!)
    func showFromTabBar(view: UITabBar!)
    @availability(iOS, introduced=3.2)
    func showFromBarButtonItem(item: UIBarButtonItem!, animated: Bool)
    @availability(iOS, introduced=3.2)
    func showFromRect(rect: CGRect, inView view: UIView!, animated: Bool)
    func showInView(view: UIView!)
时间: 2024-08-05 11:13:17

UIActionSheet的常用方法的相关文章

选择项弹窗IOS中UIActionSheet

IOS8后虽然出了新的控制器UIAlertController,但之前的UIAlertView,UIActionSheet依然可以使用. 一.初始化方法 - (instancetype)initWithTitle:(NSString *)title delegate:(id<UIActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSStrin

IOS中UIActionSheet使用方法详解

一.初始化方法 - (instancetype)initWithTitle:(NSString *)title delegate:(id<UIActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:(NSString *)otherButtonT

IOS中UIActionSheet使用详解

IOS中UIActionSheet使用方法详解 一.初始化方法 - (instancetype)initWithTitle:(NSString *)title delegate:(id<UIActionSheetDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle destructiveButtonTitle:(NSString *)destructiveButtonTitle otherButtonTitles:

IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)

在IOS 9.0 后 苹果官方宣布不再或不推荐使用UIAlertView 和 UIActionSheet 由UIAlertController进行代替两者 用控制器将两者合二为一 很简单 方便 下面就是关于UIAlertView的常用方法 #import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (void)viewDidLoad {

UIAlertView 与 UIActionSheet (提示用户)的使用方法

UIAlertView 提示用户  帮助用户选择框 //    UIAlertView *alterView = [[UIAlertView alloc] initWithTitle:@"警告" message:@"你还没把信息填完" delegate:nil  cancelButtonTitle:@"cancle" otherButtonTitles:@"确认",  nil]; //    [alterView show];

iOS学习-UIActionSheet详解

1 // 2 // ViewController.m 3 // UIActionSheet详解 4 // 5 // Created by 大欢 on 16/1/25. 6 // Copyright © 2016年 bjsxt. All rights reserved. 7 // 8 9 #import "ViewController.h" 10 11 @interface ViewController ()<UIActionSheetDelegate> 12 13 - (I

从头认识java-15.2 Collection的常用方法

这一章节我们来介绍一下Collection的常用方法. 我们下面以ArrayList为例. package com.ray.ch14; import java.util.ArrayList; import java.util.Iterator; public class Test { public static void main(String[] args) { ArrayList<Integer> rtnList = new ArrayList<Integer>(); rtnL

java中String的常用方法

java中String的常用方法1.length() 字符串的长度 例:char chars[]={'a','b'.'c'}; String s=new String(chars); int len=s.length(); 2.charAt() 截取一个字符 例:char ch; ch="abc".charAt(1); 返回'b' 3. getChars() 截取多个字符 void getChars(int sourceStart,int sourceEnd,char target[]

查看Oracle执行计划的几种常用方法-系列1

SQL的执行计划实际代表了目标SQL在Oracle数据库内部的具体执行步骤,作为调优,只有知道了优化器选择的执行计划是否为当前情形下最优的执行计划,才能够知道下一步往什么方向. 执行计划的定义:执行目标SQL的所有步骤的组合. 我们首先列出查看执行计划的一些常用方法: 1. explain plan命令 PL/SQL Developer中通过快捷键F5就可以查看目标SQL的执行计划了.但其实按下F5后,实际后台调用的就是explain plan命令,相当于封装了该命令. explain plan