zoukankan      html  css  js  c++  java
  • UIActinSheet和UIActionSheetDelegate

    UIActinSheet和UIActionSheetDelegate

    UIActinSheet和UIActionSheetDelegate

    这个是就那个UIActionSheet对象  一般用来选择类型或者改变界面。。。还有更多应用

    定义如下:
    UIActionSheet *styleAlert = [[UIActionSheet alloc] initWithTitle:@"Choose a UIBarStyle:"
                                                    delegate:self cancelButtonTitle:@"Cancel"
                                                   destructiveButtonTitle:nil
                                                   otherButtonTitles:  @"Default",
                                                                       @"BlackOpaque",
                                                                       @"BlackTranslucent",
                                                                       nil,
                                                                       nil];
       
        // use the same style as the nav bar
        styleAlert.actionSheetStyle = self.navigationController.navigationBar.barStyle;
        //styleAlert.actionSheetStyle =UIActionSheetStyleAutomatic;
        [styleAlert showInView:self.view];
        [styleAlert release];

    在委托里的操作代码如下:
    - (void)actionSheet:(UIActionSheet *)modalView clickedButtonAtIndex:(NSInteger)buttonIndex
    {
        // Change the navigation bar style, also make the status bar match with it
        switch (buttonIndex)
        {
            case 0:
            {
                [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
                self.navigationController.navigationBar.barStyle = UIBarStyleDefault;
                break;
            }
            case 1:
            {
                [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;
                self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
                break;
            }
            case 2:
            {
                [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackTranslucent;
                self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
                break;
            }
        }
    }
  • 相关阅读:
    vim的modeline
    python的read() 、readline()、readlines()、xreadlines()
    hashset
    java泛型
    eclipse常用快捷键
    互联网计费模式
    cocos2d::CCFileUtils::sharedFileUtils()->getFileData(szFile, "r", &bufferSize) 不同平台返回值不一样
    CSS为英文和中文字体分别设置不同的字体
    fatal error C1010: 在查找预编译头时遇到意外的文件结尾
    JavaScript权威指南第03章 类型、值和变量(1)
  • 原文地址:https://www.cnblogs.com/LiLihongqiang/p/5680483.html
Copyright © 2011-2022 走看看