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来安装。

最新文章

  1. Spark Shuffle原理、Shuffle操作问题解决和参数调优
  2. 集​群​t​o​m​c​a​t​+​a​p​a​c​h​e​配​置​文​档
  3. JavaScript基础插曲---apply,call和URL编码等方法
  4. 【整理】--VC 编译整理
  5. 用javascript正则表达式来格式化金额
  6. H-ui小技巧
  7. C#去掉字符串中的特殊字符
  8. volatile之一--volatile不能保证原子性
  9. XML&AJAX
  10. iframe的优缺点?
  11. Android-Gradle(二)
  12. 使用 git clone 的时候出现 fatal: Unable to find remote helper for 'https' 解决办法
  13. angular.js 教程 -- 实例讲解
  14. OpenCL 管道
  15. 转:oracle:win7手工卸载oracle数据库11g
  16. Executors提供的四种线程池和自定义线程池
  17. 3Sum - LeetCode
  18. Linux下cp ~中关于“~”的疑问
  19. 【BZOJ 2724】 2724: [Violet 6]蒲公英 (区间众数不带修改版本)
  20. 12.详解Condition的await和signal等待通知机制

热门文章

  1. Debugging Ruby in VS Code
  2. graphql pass arg
  3. 标准差(bias) 方差(variance)
  4. PHP之string之str_pad()函数使用
  5. java的IO流,字节流和字符流
  6. mongo实体设计1 tag
  7. 举一反三 willDisplayCell在UICollectionView中的一些应用
  8. 跟着Nisy一起学习C语言
  9. wpf 子窗体调用主窗体中函数的实现
  10. 删除Panl控件中窗体的方法