Ios ui design and development pop-up view

Source: Internet
Author: User

1. Alert view generally provides users with alarm information.

For example:

 

Uialertview * Alert = [[uialertview alloc] initwithtitle: Nil message: @ "the camera cannot use" delegate: Nil cancelbuttontitle: @ "Disable" otherbuttontitles: Nil];
[Alert show];
[Alert release];

 

2. Action sheet is used to prompt the user to make a choice among several possible operations. It can also be used to give the user a confirmation or cancellation opportunity when the user is about to perform irreversible dangerous operations.

 

Three steps are required to create an action sheet:

1. Specify that the corresponding viewcontroller complies with the uiactionsheetdelegate protocol.

2. Implement the corresponding delegation Method

3. Create and display the Action sheet as an option for the user, so the number of buttons must be greater than one. In addition, the text displayed on the button should be able to clearly identify the button function.

 

-(Ibaction) loadactionsheet :( ID) sender
{
Uiactionsheet * actionsheet = [[uiactionsheet alloc] initwithtitle: @ "Action sheet window"
Delegate: Self
Cancelbuttontitle: @ "close"
Destructivebuttontitle: Nil
Otherbuttontitles: @ "show alert window ",
@ "Do something", @ "do something", nil];

[Actionsheet showinview: Self. View];
[Actionsheet release];
}
// Method of the uiactionsheetdelegate Protocol
-(Void) actionsheet :( uiactionsheet *) actionsheet clickedbuttonatindex :( nsinteger) buttonindex
{
Switch (buttonindex)
{
Case 0:
{
Uialertview * Alert = [[uialertview alloc] initwithtitle: @ "alert window"
Message: @ "content btn1"
Delegate: Self
Cancelbuttontitle: @ "OK"
Otherbuttontitles: Nil];
[Alert show];
[Alert release];
}
Break;
Case 1:
{
Uialertview * Alert = [[uialertview alloc] initwithtitle: @ "alert window"
Message: @ "content btn2"
Delegate: Self
Cancelbuttontitle: @ "OK"
Otherbuttontitles: Nil];
[Alert show];
[Alert release];
}
Break;
Case 2:
{
Uialertview * Alert = [[uialertview alloc] initwithtitle: @ "alert window"
Message: @ "content btn3"
Delegate: Self
Cancelbuttontitle: @ "OK"
Otherbuttontitles: Nil];
[Alert show];
[Alert release];
}
Break;
Case 3:
{
Uialertview * Alert = [[uialertview alloc] initwithtitle: @ "Close alert window"
Message: @ "Disable content"
Delegate: Self
Cancelbuttontitle: @ "OK"
Otherbuttontitles: Nil];
[Alert show];
[Alert release];
}
Break;

Default:
Break;
}

}

 

3. Modal views is a relatively independent user interface. In this interface, you can complete something relatively independent from the software, and then exit modal view to return to the software interface. Typical examples include sending emails in the software and selecting photos from the photo library.

When designing mdal view, pay attention to the following points: first, modal view is generally full screen, and second, modal view should provide a clear button for users to exit modal view. The general practice is to display the navigation bar on it.

[Self presentmodalviewcontroller: picker animated: Yes];

Modal view example reference: http://www.cnblogs.com/hanjun/archive/2012/11/22/2783266.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.