成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

iOS開發:關于ActionSheet

移動開發 iOS
本文介紹了iOS開發中的關于ActionSheet的功能與用法,希望本文對正在學習或者是準備要開始學習iOS開發的同學起到一些作用。

顯示菜單的方法:

1、showInView

2、showFromToolBar:和showFromTabBar

視圖控制類需要是現實協議接口UIActionSheetDelegate

  1. @interface HelloController :UIViewController<UIActionSheetDelegate> 
  2. @end 

主要實現代碼:

  1. - (void)actionSheet:(UIActionSheet*)actionSheetclickedButtonAtIndex:(NSInteger)buttonIndex 
  2. printf("User Pressed Button %d\n",buttonIndex + 1); 
  3. [actionSheet release]; 
  4. - (void) presentSheet 
  5. UIActionSheet *menu = [[UIActionSheetalloc] 
  6. initWithTitle: @"FileManagement" 
  7. delegate:self 
  8. cancelButtonTitle:@"Cancel" 
  9. destructiveButtonTitle:@"DeleteFile" 
  10. otherButtonTitles:@"Rename File", @"EmailFile", nil]; 
  11. [menu showInView:self.view]; 
  12. }

類學習

UIActionSheet類

繼承UIView

Use the UIActionSheet class to presentthe user with a set of alternatives for how to proceed with a giventask. You can also use action sheets to prompt the user to confirma potentially dangerous action. The action sheet contains anoptional title and one or more buttons, each of which correspondsto an action to take. 

使用UIActionSheet類呈現給用戶一系列交替選項用于決定如何處理所給的任務。你也可以使用動作表來提示用戶確認具有潛在危險的動作。動作表包含可選標題和1個或多個按鈕,每個按鈕對應響應所給的動作。

Creating Action Sheets

  1. –initWithTitle:delegate:cancelButtonTitle:destructiveButtonTitle:otherButtonTitles: 

Setting Properties

  1. delegate  property 
  2. title  property 
  3. visible  property 
  4. actionSheetStyle property 

Configuring Buttons

  1. –addButtonWithTitle: 
  2. numberOfButtons property 
  3. –buttonTitleAtIndex: 
  4. cancelButtonIndex property 
  5. destructiveButtonIndex property 
  6. firstOtherButtonIndex property 

Presenting the Action Sheet

  1. –showFromTabBar: 
  2. –showFromToolbar: 
  3. –showInView: 
  4. –showFromBarButtonItem:animated: 
  5. –showFromRect:inView:animated: 

Dismissing the Action Sheet

  1. –dismissWithClickedButtonIndex:animated: 

備注:比對學習下UIAlertView,你會發現這兩個類基本類似

這里還有一組常量值

UIActionSheetStyle

Specifies the style of an actionsheet.

  1. typedef enum { 
  2. UIActionSheetStyleAutomatic  =-1, 
  3. UIActionSheetStyleDefault  = UIBarStyleDefault, 
  4. UIActionSheetStyleBlackTranslucent =UIBarStyleBlackTranslucent, 
  5. UIActionSheetStyleBlackOpaque  =UIBarStyleBlackOpaque, 
  6. } UIActionSheetStyle; 

Constants

UIActionSheetStyleAutomatic

Takes the appearance of the bottom bar if specified; otherwise,same as UIActionSheetStyleDefault.

UIActionSheetStyleDefault

 Thedefault style.

UIActionSheetStyleBlackTranslucent

 Ablack translucent style.

UIActionSheetStyleBlackOpaque

 Ablack opaque style.

協議接口學習

UIActionSheetDelegate協議接口

The UIActionSheetDelegate protocoldefines the methods a delegate of a UIActionSheet object shouldimplement. The delegate implements the button actions and any othercustom behavior. Some of the methods defined in this protocol areoptional.

Responding to Actions

  1. –actionSheet:clickedButtonAtIndex: 

Customizing Behavior

  1. –willPresentActionSheet: 
  2. –didPresentActionSheet: 
  3. –actionSheet:willDismissWithButtonIndex: 
  4. –actionSheet:didDismissWithButtonIndex: 

Canceling

  1. –actionSheetCancel: 
責任編輯:閆佳明 來源: blog.sina
相關推薦

2011-05-11 10:02:37

iOS

2015-01-19 12:19:04

iOS源碼ActionSheet仿QQ音樂

2014-03-12 10:13:00

iOSSEL對象

2011-08-18 11:19:13

IOS開發Core Plot S

2013-05-02 10:40:24

xcode

2017-11-06 16:00:05

iOS安卓發送原圖

2011-08-17 14:32:44

iOS開發繪制

2014-06-10 13:44:58

iOSUIImage知識點

2011-08-09 16:08:58

IOS游戲Cocos2d

2018-11-29 13:50:02

APIAPP數據集

2011-08-16 16:14:07

IOS開發HTML5通用接口

2011-07-19 15:33:57

iPhone

2011-08-18 10:39:46

iPhone開發界面

2012-03-20 21:21:59

開發

2019-07-20 23:30:48

開發技能代碼

2011-08-31 10:26:38

MTK驅動開發

2011-09-02 19:12:59

IOS應用Sqlite數據庫

2015-09-10 09:10:46

2011-08-01 17:31:25

Xcode開發 Cocoa

2011-08-24 14:33:14

LUA開發環境Decoda
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 免费黄色的视频 | 中文字幕亚洲视频 | 韩国久久精品 | 91久久久久久久久久久 | 欧美一区二区三区国产精品 | 国产精品一二三区 | 久久久久久高潮国产精品视 | 黄色大片免费网站 | 日韩三极| jizz18国产| 亚洲精品日韩在线观看 | 亚洲网站观看 | 精品欧美乱码久久久久久 | 欧美一a| 国产高清一区二区三区 | 日韩一区二区免费视频 | 成人老司机 | 99re视频在线观看 | 在线一区视频 | 久久涩涩 | 国产麻豆一区二区三区 | 国产精品国产成人国产三级 | 日本超碰在线 | 日韩在线不卡视频 | 三级黄色网址 | 超碰人人做 | 欧美乱码精品一区二区三区 | 视频在线一区二区 | 91在线精品秘密一区二区 | 免费久久网站 | 天堂va在线观看 | 国产高清在线精品一区二区三区 | 欧美国产在线一区 | 成人精品视频在线观看 | 日韩精品| 中文一区 | 嫩草视频在线免费观看 | 成人免费在线电影 | 亚洲人成人一区二区在线观看 | 中文字幕在线观看一区二区 | 亚洲精美视频 |