zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    镜像的上传和下载
    ps 命令
    过滤不合格数据
    云计算5-3-2法则
    Python Django初入门
    python web框架
    BootStrap、EasyUI、JQueryUI
    JS正则
    ngonx FastCGI 相关参数调优
    Windows10远程连接错误-出现身份验证错误
  • 原文地址:https://www.cnblogs.com/foxmin/p/2393599.html
Copyright © 2011-2022 走看看