Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom UIAlertView. Continue adding images and UIViews to dialogs in iOS7+

License

NotificationsYou must be signed in to change notification settings

Moespirit/CustomIOSAlertView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CustomIOSAlertView for Xamarin

Custom iOS AlertView

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.

A demo screen

Install

NuGet

Change notes

  • 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.

Quick start guide

  1. Create the UIView objectchanged

    CustomIOSAlertViewalertView=newCustomIOSAlertView();
  2. Add some custom content to the alert view (optional)

    UIViewcustomView ..;alertView.ContainerView=customView;
  3. Display the dialog

    alertView.Show();

More functions

  • 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()};

Todos

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

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp