LvModelWindow 0.1.7

LvModelWindow 0.1.7

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布上次发布2017 年 8 月

Peng GuangBo 维护。



简介

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

安装

使用

初始化

_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;
});

作者

pgbo, [email protected]

许可

LvModelWindow 基于 MIT 许可。有关更多信息,请参阅 LICENSE 文件。