- Notifications
You must be signed in to change notification settings - Fork3
Custom UIAlertView. Continue adding images and UIViews to dialogs in iOS7+
License
Moespirit/CustomIOSAlertView
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
CustomIOSAlertView for Xamarin
v0.9.5
support for iOS7+
The addSubview is not available in UIAlertView since iOS7. The view hierarchy for this class is private and must not be modified.
As a solution, this class creates an iOS-style dialog which you can extend with any UIViews or buttons. The animations and the looks are copied too and no images or other resources are needed.
Fixed rotation for IOS8
Removed 7 from the class name. Just use CustomIOSAlertView from now on, like: [[CustomIOSAlertView alloc] init];
The initWithParentView method is now deprecated. Please use the init method instead, where you don't need to pass a parent view at all.In case the init doesn't work for you, please leave a note or open an issue here.
Create the UIView object
changedCustomIOSAlertViewalertView=newCustomIOSAlertView();
Add some custom content to the alert view (optional)
UIViewcustomView ..;alertView.ContainerView=customView;
Display the dialog
alertView.Show();
Close the dialog
alertView.Close();
To add more buttons, pass a list of titles
alertView.ButtonTitles=newNSString[]{newNSString("Button1"),newNSString("Button2"),newNSString("Button3")}
You can remove all buttons by passing nil
alertView.ButtonTitles=null;
You can enable or disable the iOS7 parallax effects on the alert view
alertView.UseMotionEffects=true;
Handle button clicks with a custom delegate
Add the delegate methods:
alertView.ButtonClicked+=(sender,intargs)=>{...};
Handle button clicks with a code block
alertView.ButtonClicked+=(sender,intargs)=>{alertView.Close()};
This is a really quick implementation, and there are a few things missing:
Adding more buttons: they don't exactly match the look with that of on iOS7
Rotation: rotates wrong with the keyboard on
About
Custom UIAlertView. Continue adding images and UIViews to dialogs in iOS7+
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
