国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

iOS中UIActionSheet動態添加按鈕

2019-10-21 18:45:59
字體:
來源:轉載
供稿:網友

一,效果圖。

ios,動態添加按鈕,UIActionSheet

二,代碼。

RootViewController.h

#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UIActionSheetDelegate>@end 

RootViewController.m

//點擊任何處,彈出UIActionSheet-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{  UIActionSheet *sheet=[[UIActionSheet alloc]initWithTitle:@"標題" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil, nil];  // 逐個添加按鈕(比如可以是數組循環)  [sheet addButtonWithTitle:@"Item A"];  [sheet addButtonWithTitle:@"Item B"];  [sheet addButtonWithTitle:@"Item C"];  // 同時添加一個取消按鈕  [sheet addButtonWithTitle:@"Cancel"];  sheet.cancelButtonIndex = sheet.numberOfButtons-1;  [sheet showInView:self.view];}

以上所述是小編給大家介紹的iOS中UIActionSheet動態添加按鈕,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對VEVB武林網網站的支持!


注:相關教程知識閱讀請移步到IOS開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 阿坝| 屏南县| 康定县| 科尔| 丹巴县| 洪雅县| 仪陇县| 新乡市| 晋江市| 东山县| 清涧县| 绥化市| 成武县| 江川县| 库尔勒市| 夏津县| 德清县| 靖江市| 襄樊市| 高淳县| 北宁市| 淮滨县| 临城县| 麟游县| 西青区| 大竹县| 寿阳县| 繁昌县| 桂阳县| 阳西县| 兴海县| 扎鲁特旗| 盈江县| 辽源市| 确山县| 泰州市| 五河县| 马尔康县| 新丰县| 灵石县| 黄石市|