• iPhone控件之UIActionSheet


     1 //
    2 // UITestViewController.m
    3 // UITest
    4 //
    5
    6 #import "UITestViewController.h"
    7
    8 @implementation UITestViewController
    9
    10 - (void)viewDidLoad {
    11
    12 [super viewDidLoad];
    13
    14 UIActionSheet *mySheet = [[UIActionSheet alloc] initWithTitle:@"Email Deletion Options"
    15 delegate:self
    16 cancelButtonTitle:@"Cancel"
    17 destructiveButtonTitle:@"Delete Everything"
    18 otherButtonTitles:@"All Read Email", @"Spam Only",nil];
    19
    20
    21 mySheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
    22 [mySheet showInView:self.view];
    23
    24 [mySheet release];
    25 }
    26
    27 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    28
    29 BOOL cancelClicked = actionSheet.cancelButtonIndex == buttonIndex;
    30 BOOL destructiveButtonClicked = actionSheet.destructiveButtonIndex == buttonIndex;
    31
    32 NSLog(@"button with index %i clicked (cancel:%i, destructive:%i)",buttonIndex,cancelClicked,destructiveButtonClicked);
    33
    34 }
    35
    36 - (void)didReceiveMemoryWarning {
    37 // Releases the view if it doesn't have a superview.
    38 [super didReceiveMemoryWarning];
    39
    40 // Release any cached data, images, etc that aren't in use.
    41 }
    42
    43 - (void)viewDidUnload {
    44 // Release any retained subviews of the main view.
    45 // e.g. self.myOutlet = nil;
    46 }
    47
    48
    49 - (void)dealloc {
    50 [super dealloc];
    51 }
    52
    53 @end
  • 相关阅读:
    服务器控件Repeater
    HeidiSQL无法连接Myql
    未在本地计算机上注册“Microsoft.ACE.OLEDB.12.0”提供程序搜索
    DISTINCT删除重复数据
    Makedown文件保存问题
    Makedown 本地图片问题
    vsftpd配置文件详解[转载]
    centos 本地yum源的搭建
    OpenOffice菜单乱码解决和linux下安装字体
    让secureCRT正确显示中文
  • 原文地址:https://www.cnblogs.com/foxmin/p/2393599.html
Copyright © 2020-2023  润新知