iPhone - a UI component that looks like an Alert box - Beginner
I need to know what this UI component is called ? It looks like an Al开发者_StackOverflow社区ert
but has textfeilds
and buttons
in it ?
1.) What is this UIComponent called ? 2.) Is there any video tutorial which shows how to implement this ? (If so link) or any tutorials that discuss the implementation of this
- It's UIAlertView
- Here is the tutorial to make custom UIAlertView
That is an Android component, there is no equivalent in iOS.
There is the UIAlertView, but you cannot edit text within it. http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIAlertView_Class/UIAlertView/UIAlertView.html#//apple_ref/occ/cl/UIAlertView
If you want to be able to let users edit text in the component, you have to create it from scratch, e.g. create a UIView and add a UITextView to it and some UIButtons and create the functionality to display/dismiss the component yourself.
AlertView
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message"
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:nil];
[alert show];
[alert release];
The component on iPhone is called a UIAlertView. You can add subviews in it to get text-fields, although this is not recommended by Apple - but you won't get rejected either. In iOS5, there are dedicated UIAlertView types for this. If you are building for iOS5, this is the method you should use.
精彩评论