[翻译] KGModal

简介:

KGModal

KGModal is an easy drop in control that allows you to display any view in a modal popup. The modal will automatically scale to fit the content view and center it on screen with nice animations!

KGModal允许你用pop出你的view,要显示的view会自动的缩放到合适的级别,并在屏幕中间,动画效果很炫哦!

You supply your own content view and KGModal does the rest:

你需要提供你的内容view,之后就交给KGModal就行了:

[[KGModal sharedInstance] showWithContentView:contentView andAnimated:YES];

There are a couple other options but it's purposely designed to be simple and easy to use:

当然,还有好多其他属性供你设置,使用起来很简单哦:

// Determines if the modal should dismiss if the user taps outside of the modal view
// Defaults to YES
@property (nonatomic) BOOL tapOutsideToDismiss;

// Determines if the close button or tapping outside the modal should animate the dismissal
// Defaults to YES
@property (nonatomic) BOOL animateWhenDismissed; // Determins close button type (None/Left/Right) // Defaults to Left @property (nonatomic) KGModalCloseButtonType closeButtonType; // Determines whether close button will display on the left or right // Defaults to left @property (nonatomic) KGModalCloseButtonLocation closeButtonLocation; // The background color of the modal window // Defaults black with 0.5 opacity @property (strong, nonatomic) UIColor *modalBackgroundColor; // The background display style, can be a transparent radial gradient or a transparent black // Defaults to gradient, this looks better but takes a bit more time to display on the retina iPad @property (nonatomic) enum KGModalBackgroundDisplayStyle backgroundDisplayStyle; // The shared instance of the modal + (id)sharedInstance; // Set the content view to display in the modal and display with animations - (void)showWithContentView:(UIView *)contentView; // Set the content view to display in the modal and whether the modal should animate in - (void)showWithContentView:(UIView *)contentView andAnimated:(BOOL)animated; // Hide the modal with animations - (void)hide; // Hide the modal with animations, // run the completion after the modal is hidden - (void)hideWithCompletionBlock:(void(^)())completion; // Hide the modal and whether the modal should animate away - (void)hideAnimated:(BOOL)animated; // Hide the modal and whether the modal should animate away, // run the completion after the modal is hidden - (void)hideAnimated:(BOOL)animated withCompletionBlock:(void(^)())completion;

Check out the ExampleApp to see it in action!

你可以在ExampleApp中查看效果!

Installation via Cocoapods 通过Cocoapods来安装

Add pod 'KGModal', '~> 0.0.1' to your Podfile and run pod to install.

添加 KGModal ,然后运行pod来安装。

目录
相关文章
|
存储 自然语言处理 前端开发
从零写一个Recoil(翻译)
Rewriting Recoil from scratchrecoil是facebook编写的一个库,它之所以诞生是因为人体工程学、context的性能问题和useState。这是一个非常聪明的库,几乎每个人都会找到它的用途——如果你想了解更多,请查看这段解释视频。刚开始我被图论和recoil惊到了,但渐渐的理解后,感觉也没那么特别了。也许我也可以实现一个类似的东西。我自己实现的版本和recoil
233 0
从零写一个Recoil(翻译)
|
XML Java Android开发
[翻译]IAdaptable是什么?
IAdaptable在Eclipse里是一个非常重要的接口。对于Eclipse开发老手来说,它就像异常处理和抽象类一样寻常;但是对新手而言,它却令人感到困惑和畏惧。这篇文章将向你解释IAdaptable到底是什么,以及它在Eclipse里起到的作用。
1209 0
《Wir wilden weisen Frauen》翻译——<连载>
上周去逛图书馆,借了本德语原版的书。今天突然想起来了,就翻开来看。我不知道这本书是否有中文版的,不管有没有吧,我尝试翻译一下以提高自身的德语水平。每天花上一个半小时来翻译,我想应该不能翻译出来几句的。
797 0
|
iOS开发 编译器 Go
|
开发工具 iOS开发 MacOS
|
存储 iOS开发 Perl