• ios UI设计与开发 弹出式视图


    1.Alert View 一般给用户提供告警信息。

     如: 


    UIAlertView *alert =[[UIAlertView alloc] initWithTitle:nil message:@"相机不能用" delegate:nil cancelButtonTitle:@"关闭" otherButtonTitles:nil];
            [alert show];
            [alert release];

    2.Action Sheets用来提示用户在可能的几种操纵中作出选择,也可以用来在用户将要进行不可逆的危险操作时,给用户确认或取消的机会。

        创建Action Sheets 需要3个步骤:

    1.指定相应的ViewController遵循UIActionSheetDelegate协议

    2.实现相应的delegation方法

    3.创建并显示Action Sheet是给用户选项,所以按钮数目肯定要大于一个。另外,按钮上显示的文字应该能够明确标识按钮的功能。 

     

    - (IBAction)loadActionSheet:(id)sender 
    {
        UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Action Sheet窗口" 
                                                                 delegate:self 
                                                        cancelButtonTitle:@"关闭" 
                                                   destructiveButtonTitle:nil 
                                                        otherButtonTitles:@"显示Alert窗口"
                                      @"do sth"@"do sth", nil];
        
        [actionSheet showInView:self.view];
        [actionSheet release];
    }
    //UIActionSheetDelegate协议的方法
    - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
    {
        switch (buttonIndex)
        {
            case 0:
            {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert窗口" 
                                                                message:@"内容 btn1" 
                                                               delegate:self 
                                                      cancelButtonTitle:@"确认"
                                                      otherButtonTitles:nil];
                [alert show];
                [alert release];
            }
                break;
            case 1:
            {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert窗口" 
                                                                message:@"内容 btn2" 
                                                               delegate:self 
                                                      cancelButtonTitle:@"确认"
                                                      otherButtonTitles:nil];
                [alert show];
                [alert release];
            }
                break;
            case 2:
            {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert窗口" 
                                                                message:@"内容 btn3" 
                                                               delegate:self 
                                                      cancelButtonTitle:@"确认"
                                                      otherButtonTitles:nil];
                [alert show];
                [alert release];
            }
                break;
            case 3:
            {
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"关闭alert窗口" 
                                                                message:@"内容 关闭" 
                                                               delegate:self 
                                                      cancelButtonTitle:@"确认"
                                                      otherButtonTitles:nil];
                [alert show];
                [alert release];
            }
                break;
                
            default:
                break;
        }

    3.Modal Views 是弹出的相对独立的用户界面,在这个界面中用户可以完成一些相对独立于软件的事物,完成后可以退出Modal View返回软件界面。比较典型的例子包括在软件中发送邮件、从相片库中选取照片等。 

         设计使用Mdal View的时候需要注意几点:首先Modal View一般都是全屏,其次Modal View应该提供明确的让用户退出Modal View的按钮,一般做法是在上面显示导航条。 

           [self presentModalViewController:picker animated:YES];

        Modal View 示例参照:http://www.cnblogs.com/hanjun/archive/2012/11/22/2783266.html 
  • 相关阅读:
    vscode 鸿蒙开发板hi3861 hispark需要使用Jlink V10以上版本仿真器,才支持RISC-V,在线调试
    hi3861 hispark GDB openOCD 调试器仿真器在vscode中如何使用呢?
    ArduinoUNO R3接口定义
    OpenOCD-HI3861-RISCV使用方法 (JTAG/DTM+SWD/CoreSight)调试器仿真器
    c#字符串序列化-字符串转对象转字符串
    c#winform设置字体字号大小
    SAP MM——常用表
    C++ WIN32 日志程序
    C++ WIN32 程序 ,从屏幕输入 数据 然后给WCHAR 数组赋值
    Ubuntu 16.04开启SFTP服务
  • 原文地址:https://www.cnblogs.com/hanjun/p/2785724.html
Copyright © 2020-2023  润新知