Latest 0.1.7
Homepage https://github.com/pgbo/LvModelWindow
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit
Authors

CI Status
Version
License
Platform

简介

通过LvModelWindow能够轻易实现任意自定义视图、任意自定义动画。LvModelWindow是一个弹出视图的wrapper Window,可添加自定义视图、自定义动画,支持StatusBar隐藏,支持屏幕旋转。

安装

cocoapods

将下面的语句加入到你的Podfile:

pod "LvModelWindow"

使用

初始化

_modelWindow = [[LvModelWindow alloc]initWithPreferStatusBarHidden:NO preferStatusBarStyle:UIStatusBarStyleLightContent supportedOrientationPortrait:NO supportedOrientationPortraitUpsideDown:NO supportedOrientationLandscapeLeft:NO supportedOrientationLandscapeRight:NO];
_modelWindow.modelWindowDelegate = self;

添加自定义视图到 Window 上,举例:添加一个 UILabel

UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 100, CGRectGetWidth(self.view.bounds), 64)];
[_modelWindow.windowRootView addSubview:label];
_modelWindow.windowRootView.backgroundColor = [UIColor blackColor];

label.text = @"😄我显示出来了, 再点我就会消失";
label.backgroundColor = [UIColor whiteColor];
label.textColor = [UIColor blackColor];
label.textAlignment = NSTextAlignmentCenter;

label.userInteractionEnabled = YES;
[label addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismissModelWindow)]];

### 设置动画实体,举例:添加一个 DefaultModelWindowAnimation
_modelWindow.modelWindowAnimation = ({
    DefaultModelWindowAnimation *animation = [[DefaultModelWindowAnimation alloc]init];
    animation.touchBackgroudView = _modelWindow.windowRootView;
    animation.contentView = label;
    animation;
});

Author

pgbo, [email protected]

License

LvModelWindow is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LvModelWindow",
    "version": "0.1.7",
    "summary": "LvModelWindowu662fu4e00u4e2au5f39u51fau89c6u56feu7684wrapper Windowuff0cu53efu6dfbu52a0u81eau5b9au4e49u89c6u56feu3001u81eau5b9au4e49u52a8u753buff0cu652fu6301StatusBaru9690u85cfuff0cu652fu6301u5c4fu5e55u65cbu8f6cu3002",
    "description": "u901au8fc7LvModelWindowu80fdu591fu8f7bu6613u5b9eu73b0u4efbu610fu81eau5b9au4e49u89c6u56feu3001u4efbu610fu81eau5b9au4e49u52a8u753bu3002LvModelWindowu662fu4e00u4e2au5f39u51fau89c6u56feu7684wrapper Windowuff0cu53efu6dfbu52a0u81eau5b9au4e49u89c6u56feu3001u81eau5b9au4e49u52a8u753buff0cu652fu6301StatusBaru9690u85cfuff0cu652fu6301u5c4fu5e55u65cbu8f6cu3002",
    "homepage": "https://github.com/pgbo/LvModelWindow",
    "license": "MIT",
    "authors": {
        "pgbo": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pgbo/LvModelWindow.git",
        "tag": "0.1.7"
    },
    "social_media_url": "https://github.com/pgbo",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This