GithubHelp home page GithubHelp logo

lyb5834 / ybpopupmenu Goto Github PK

View Code? Open in Web Editor NEW
877.0 18.0 175.0 3.19 MB

快速集成popupMenu

License: MIT License

Objective-C 98.66% Ruby 0.43% Swift 0.91%
popup-menu menu pop qq weixin popup bubble bubbles wechat

ybpopupmenu's Issues

分屏

在分屏状态下,如果右侧距离window右侧比较近时会出现右侧被遮挡一部分的问题

无法修改线条颜色

我这里使用了iOS14.4.1系统,测试想修改线条颜色,发现一个问题,当我在- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier这个方法里面打印_separatorColor属性的时候输出是UIExtendedSRGBColorSpace 1 0 0 1,但是当我在- (void)drawRect:(CGRect)rect里面打印的时候输出的是<UIDynamicSystemColor: 0x283a45440; name = separatorColor>,不管怎么修改_separatorColor颜色,都是无法改变的。所以如果解决此问题呢

崩溃问题

[YBPopupMenu showAtPoint:p titles:TITLES icons:nil menuWidth:110 otherSettings:^(YBPopupMenu *popupMenu) {
popupMenu.dismissOnSelected = NO;
popupMenu.isShowShadow = YES;
// 示例代码这里要弱引用 不然点着点着就崩溃了 (当然对于使用者来说 block弱引用常识问题 但是对于写文档来说 还是有问题的)
popupMenu.delegate = self;
popupMenu.offset = 10;
popupMenu.type = YBPopupMenuTypeDark;
popupMenu.rectCorner = UIRectCornerBottomLeft | UIRectCornerBottomRight;
popupMenu...;
}];

提一个小建议

当展示不下时,能否在最低下那一个露出一部分,让用户知道可以往下滑动

看到你说代码全部重构,就看得出你花心思了。刚下载喵了一眼,说2个我看到的现象。

1.文本输入框呼唤出键盘后,你要让人家可以退出键盘啊,弹出来键盘就退不出去,还要人家重启程序。
2.如果在5s上运行,点击文本输入框,你的PopupMenu显示在文本输入框的上方,而5s屏幕比较小,以至于你的PopupMenu超出屏幕边界了,应该是没有做屏幕适配或者边界处理
3.iPhoneX出来了,要想让你的框架更被广泛使用,必须适配iPhoneX,iPhoneX是朵奇葩

Window问题

[UIApplication sharedApplication].keyWindow
在iOS 14中会获取到nil,此API已被苹果标记为Deprecated

实例化方法

因为坐标计算的关系,不能用属性变量存储,也就是每次show就必须实例化一个,否则会出现显示错误
2016-12-01 3 05 00

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    _addBtn = ({
        UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        addBtn.frame = CGRectMake(0, 0, 60, 40);
        addBtn.backgroundColor = [UIColor redColor];
        
        addBtn;
    });
    [_addBtn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithCustomView:_addBtn];
    self.navigationItem.rightBarButtonItem = rightItem;

    _addMenu = ({
        YBPopupMenu *menu = [[YBPopupMenu alloc] initWithTitles:@[@"1",@"2",@"3"] icons:nil menuWidth:100 delegate:self];
        
        menu;
    });
}

- (void)btnClick:(UIButton *)sender
{
//    _addMenu = ({
//        YBPopupMenu *menu = [[YBPopupMenu alloc] initWithTitles:@[@"1",@"2",@"3"] icons:nil menuWidth:100 delegate:self];
//        
//        menu;
//    });
    
    [_addMenu showRelyOnView:_addBtn];
    
//    [YBPopupMenu showRelyOnView:_addBtn titles:@[@"1",@"2",@"3"] icons:nil menuWidth:100 delegate:self];
}

在-show方法中获取最后一个可见的cell有问题

在-show方法中通过getLastVisibleCell获取最后一个可见的cell时有问题,如下图
151558955465_ pic

改进方案:
image

另外能否开发设置阴影透明度和颜色属性,默认的阴影有些生硬。
谢谢作者提供好用的控件,忘能改进以上两项,
再次感谢~

在 iOS13 以上的系统里,弹不出来

应该是这一句在 iOS13 里拿不到 window #define YBMainWindow [UIApplication sharedApplication].delegate.window

改成 #define YBMainWindow [[UIApplication sharedApplication] keyWindow] 就没问题了

现在似乎只能通过类方法来创建使用

遇到一个问题,需要用户在TextField中,随着输入公司名称的同时,不停匹配相应的名称数据。这样子似乎会不停创建PopMenu堆积在界面上,而且titles和images数组属性也是只读的,无法设置

关于点击按钮弹出menu的问题

这边基于点击按钮自动判断向上弹还是向下弹,这边的一个标准是什么?按钮处于什么位置是是向下弹的?为什么我把按钮设置在了中间偏下 他也会往下弹?

在有导航栏的情况下

在有导航栏的情况下,如果开启了self.navigationController.navigationBar.translucent = NO; 则显示会上移。

设置没有箭头不起作用

[YBPopupMenu showAtPoint:point titles:titleArray icons:nil menuWidth:AIscaleX(160) otherSettings:^(YBPopupMenu *popupMenu) {
popupMenu.arrowDirection = YBPopupMenuArrowDirectionNone;
popupMenu.delegate = self;
popupMenu.tintColor = ColorOfTheme_Main;
popupMenu.cornerRadius = 0;
// popupMenu.offset = AIscaleY(25);
}];

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.