GithubHelp home page GithubHelp logo

snail-z / zhpopupcontroller Goto Github PK

View Code? Open in Web Editor NEW
1.5K 42.0 259.0 7.46 MB

Help you pop up custom views easily. and support pop-up animation, layout position, mask effect and gesture interaction etc.

License: MIT License

Ruby 0.77% Objective-C 99.23%
mask alert popup present spring sina qzone custom-view actionsheet share

zhpopupcontroller's Issues

pod的问题

根据前面的issues解决了在pod上搜索不到的问题,pod到项目里面之后,却一直引用不了,命令行提示:Unable to read the license file /Users/XXX/XXX/Pods/SnailPopupController/LICENCE for the spec SnailPopupController (2.0.6)

'zhPopupController.h' file not found

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.

弹窗控制器的view代理方法问题

[self.zh_popupController presentContentView:forceEvaluateVc.view];弹窗出的是控制器的view,在控制器的view上再加一个view,然后设置代理时,forceEvaluateVc里面的代理方法不执行

会与IQKeyboardManager冲突

项目中导入IQKeyboardManager后,Keyboard style1中弹框直接顶出屏幕,不在屏幕中间。请看下如何解决

拖拽手势的判定逻辑需要优化

当要弹的view的高度小于屏幕高度一半的时候,拖拽结束时,即使放手时view的位置和拖拽前一样,判定的任然是需要消失。应该在拖拽手势结束时比较的是弹框view离原来的位置拖动了多少比例,即self.maskView.bounds.size.height * self.panDismissRatio这里不应该用maskView的高度去比较

背景视图无法消失

@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不见了,但是背景图没有消失

有个bug

连续弹出2个view就消失不了

弹出的视图内包含UITextView,当UITextView成为第一响应者后,视图上移的位置不准确

当文本框成为第一响应者后,有可能多次接收到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);

能设置window的级别吗

能设置window的级别吗,和SVProgressHUD一起显示的话会遮挡 ,并且是否能自定义当前弹窗window的级别

zhPopupController dealloc.

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

仿新浪弹框bug

在iOS8系统下demo是正常的
但是在iOS11系统下仿新浪微博那个弹窗,有两个bug

  1. 里面item不乏点击了
  2. _scrollContainer不能像右边滚动切换第二页了

弹窗添加table 报错

在弹出框上添加一个table 在懒加载table就产生报错:invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug.

关于使用[self.zh_popupController dismiss]

调用[self.zh_popupController dismiss] 没有消失自定义的弹窗视图 这是在网络请求成功后dismiss视图 并在网络请求成功后 push控制器(主线程push),导致没有消失自定义的弹窗视图,希望能解答

貌似你拿到的不是当前的主window,虽然你有特别处理

问题是这两天刚发现的,项目里面有两个长存的window,主window和另外一个,然后你的方法默认就去那了另外一个,view就被加在了那个window上,而不是主window,我解决办法是应用启动的时候通过单例保存了主window,然后修改了你获取window的方法

zhPopupController被释放,添加的tap手势将会失效

创建视图完成之后,zhPopupController如果没有被引用将会被释放,popups还是可以正常显示的,但是这个时候关闭popups的手势tap的target为空,手势失效。可否考虑将zhPopupController写成单例

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.