snail-z / zhpopupcontroller Goto Github PK
View Code? Open in Web Editor NEWHelp you pop up custom views easily. and support pop-up animation, layout position, mask effect and gesture interaction etc.
License: MIT License
Help you pop up custom views easily. and support pop-up animation, layout position, mask effect and gesture interaction etc.
License: MIT License
当文本框成为第一响应者后,有可能多次接收到UIKeyboardWillChangeFrameNotification通知,
在通知处理方法(keyboardWillChangeFrame:)中,设置_popupView.center的Y值是根据当前Y值计算出来的,建议通过获取键盘前后位置差值来设置_popupView.center。
// if (!CGPointEqualToPoint(CGPointZero, _markerCenter)) {
// _popupView.center = CGPointMake(_markerCenter.x, _markerCenter.y - changeHeight);
// } else {
// _popupView.center = CGPointMake(_popupView.center.x, _popupView.center.y - changeHeight);
// }
CGRect beginKeyboardRect = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
CGRect endKeyboardRect = [[userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGFloat yOffset = endKeyboardRect.origin.y - beginKeyboardRect.origin.y;
_popupView.center = CGPointMake(_popupView.center.x, _popupView.center.y + yOffset - self.offsetSpacingOfKeyboard);
UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 屏幕宽 * 0.8, 213)];
self.zh_popupController = [[zhPopupController alloc] init];
self.zh_popupController.layoutType = zhPopupLayoutTypeLeft;
self.zh_popupController.allowPan = YES ;
[self.zh_popupController presentContentView:v];
无效打印
zhPopupController dealloc
在iOS8系统下demo是正常的
但是在iOS11系统下仿新浪微博那个弹窗,有两个bug
问题是这两天刚发现的,项目里面有两个长存的window,主window和另外一个,然后你的方法默认就去那了另外一个,view就被加在了那个window上,而不是主window,我解决办法是应用启动的时候通过单例保存了主window,然后修改了你获取window的方法
在已经弹出的第一个视图上再弹出第二个视图,如何在第二个视图dissmiss后,保留第一个视图???
使用xcode 9 编译。
1.必须每次都new,否则弹出一次,第二次弹就看不见了。
self.zh_popupController= [zhPopupController new];
[self.zh_popupController presentContentView:subtitleConfigView];
2.使用几次后,旋转手机,屏幕不能旋转了。。。
在iOS11 上自定义视图会一闪而过,而且底部遮罩也没有显示,个人猜想是不是因为iOS11获取win的方式改变了导致获取不到最外层的win;
#参考链接 https://zhuanlan.zhihu.com/p/30045683
@interface ViewController ()
@Property (nonatomic, strong) zhPopupController *popupVC;
@EnD
@implementation ViewController
(IBAction)click1:(id)sender {//按钮的点击事件
UIView *popView = [[UIView alloc]initWithFrame:CGRectMake(100, 100, [UIScreen mainScreen].bounds.size.width, 216)];
[self.popupVC.zh_popupController presentContentView:popView];
}
(zhPopupController *)popupVC {
if (!_popupVC) {
_popupVC = [zhPopupController popupControllerWithMaskType:zhPopupMaskTypeWhite];
_popupVC.zh_popupController.layoutType = zhPopupLayoutTypeBottom;
_popupVC.zh_popupController.allowPan = YES;
}
return _popupVC;
}
@EnD
点击后,popView不见了,但是背景图没有消失
https://raw.githubusercontent.com/snail-z/zhPopupController/master/Preview/_zhPopupController_ios11.gif
这里面有个效果就是从底部弹出然后里面的按钮有个弹簧的动画效果,请问是这个框架已经实现了吗?还是要自己写?
官方给出的例子也是这样。
开始还可以旋转,
弹了几次以后,不能旋转了。
iPhone x底部弹出没有去掉安全区域
self.zh_popupController.maskTouched = ^(zhPopupController * _Nonnull popupController) {
[popupController dismissWithDuration:0.25 springAnimated:NO];
};这段代码不执行
调用[self.zh_popupController dismiss] 没有消失自定义的弹窗视图 这是在网络请求成功后dismiss视图 并在网络请求成功后 push控制器(主线程push),导致没有消失自定义的弹窗视图,希望能解答
MBProgressHUD的每一次弹出都是带动画从view的侧边弹出来
我弹出视图的时候,长连接推送过来跳转页面,我需要判断当前有没有视图弹出来调用dismiss函数
如题,复现的话可以在demo里创建弹窗VIew前打断点,然后home键挂起App,再继续运行,运行完弹窗的代码把App恢复前台运行,这时候弹窗就不会响应事件了
在iPad横竖屏切换的时候,内容View宽高变形,背景View不满屏遮罩
很多旧项目使用的都是1.0.x的版本,且没有迭代计划,请问可以把旧版本开启回来吗?
[self.zh_popupController presentContentView:forceEvaluateVc.view];弹窗出的是控制器的view,在控制器的view上再加一个view,然后设置代理时,forceEvaluateVc里面的代理方法不执行
根据前面的issues解决了在pod上搜索不到的问题,pod到项目里面之后,却一直引用不了,命令行提示:Unable to read the license file /Users/XXX/XXX/Pods/SnailPopupController/LICENCE
for the spec SnailPopupController (2.0.6)
只能弹出来一次 不知道你们遇到这个问题没
我在自己的代码中另外引用了Masonry,会跟他的MASShorthandAdditions冲突导致不能正确布局,我改了你的demo的的UIView+Layout里的bottom属性才能正确布局出来
进入视图控制器后,如果在调用present方法前,先调 self.zh_popupcontroller dismiss 会导致界面出现灰色挡板无法操作,看了代码发现 会在初始化方法里面直接添加到keywindow ,希望处理下。
创建视图完成之后,zhPopupController如果没有被引用将会被释放,popups还是可以正常显示的,但是这个时候关闭popups的手势tap的target为空,手势失效。可否考虑将zhPopupController写成单例
view先在竖屏时弹出,旋转至横屏再弹出时view坐标不对,望改善
你好,弹出的时候怎么改变状态栏的颜色?
我设置了
-(UIStatusBarStyle)preferredStatusBarStyle
{
return UIStatusBarStyleDefault;
}
没有效果,求解
连续弹出2个view就消失不了
在弹出框上添加一个table 在懒加载table就产生报错:invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug.
可以设置自定义弹出视图的位置往上偏移点吗?不用太居中,希望有个属性可以设置,O(∩_∩)O谢谢
Swift项目中很多这种警告
Hi,
I am not able to click on uibutoon added in custom view.
Please help me out.
Regards
Alok
Hi there,
I tried to use this great library in my old app, but I got an error 'zhPopupController.h' file not found, anybody have an idea what cause this problem. thanks in advance.
项目中导入IQKeyboardManager后,Keyboard style1中弹框直接顶出屏幕,不在屏幕中间。请看下如何解决
能设置window的级别吗,和SVProgressHUD一起显示的话会遮挡 ,并且是否能自定义当前弹窗window的级别
当我把右下角的按钮 背景色换掉后,右下角的按钮 圆角没了
当要弹的view的高度小于屏幕高度一半的时候,拖拽结束时,即使放手时view的位置和拖拽前一样,判定的任然是需要消失。应该在拖拽手势结束时比较的是弹框view离原来的位置拖动了多少比例,即self.maskView.bounds.size.height * self.panDismissRatio这里不应该用maskView的高度去比较
在适配iphoneX屏幕的时候,底部遮挡了操作栏
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.