zoukankan      html  css  js  c++  java
  • 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 
  • 相关阅读:
    工作问题:http下载文件,中文文件名在firefox下乱码问题
    Error:不能将"char*"类型的值分配到"LPSTR"类型的实体 也许 "char*"类型的实参与"LPCWSTR"类型的形参不兼容
    Kryonet client disconnects after send a packet to server (java)
    NetBeans Support Weblog
    When Deep Learning Meets Data Alignment: A Review on Deep Registration Networks (DRNs)
    DeepFakes and Beyond: A Survey of Face Manipulation and Fake Detection
    Sketch-to-Art: Synthesizing Stylized Art Images From Sketches
    (转载)除了 MSE loss,也可以试试用它:SSIM 的原理和代码实现
    Face X-ray for More General Face Forgery Detection
    FaceShifter: Towards High Fidelity And Occlusion Aware Face Swapping
  • 原文地址:https://www.cnblogs.com/hanjun/p/2785724.html
Copyright © 2011-2022 走看看