lyb5834 / ybpopupmenu Goto Github PK
View Code? Open in Web Editor NEW快速集成popupMenu
License: MIT License
快速集成popupMenu
License: MIT License
在分屏状态下,如果右侧距离window右侧比较近时会出现右侧被遮挡一部分的问题
按钮设置回显
比如给修改右上角加一个小红点,怎么拿到修改这个View
提个小细节,不知道有没有注意到
YBPopupMenu圆角的时候,选中边角会把圆角变方了
当然只是小细节
当iPad旋转的时候,弹窗的背景和位置就不对了,有时间就适配一下呗。
animationManager.style = YBPopupMenuAnimationStyleNone 的时候,不响应- (void)ybPopupMenu:(YBPopupMenu *)ybPopupMenu didSelectedAtIndex:(NSInteger)index
我这里使用了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颜色,都是无法改变的。所以如果解决此问题呢
加上文字可以居中最好
menuBackView 遮罩层背景颜色无法自定义
[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...;
}];
当展示不下时,能否在最低下那一个露出一部分,让用户知道可以往下滑动
YBPopupMenu里面代码有点冗杂,建议 tableView 抽出.
1.文本输入框呼唤出键盘后,你要让人家可以退出键盘啊,弹出来键盘就退不出去,还要人家重启程序。
2.如果在5s上运行,点击文本输入框,你的PopupMenu显示在文本输入框的上方,而5s屏幕比较小,以至于你的PopupMenu超出屏幕边界了,应该是没有做屏幕适配或者边界处理
3.iPhoneX出来了,要想让你的框架更被广泛使用,必须适配iPhoneX,iPhoneX是朵奇葩
在底部弹出,箭头在左右两边,内容无法显示
如题,体验有些不好,只要我手速够快一直点击,他就会一直重复执行,可以加个状态值判断,望有时间修复下
[UIApplication sharedApplication].keyWindow
在iOS 14中会获取到nil,此API已被苹果标记为Deprecated
建议你把这个库的代码优化一下。
如题...得优化一下.
默认向上显示!
作者能提供 一个cell高度自适应的接口
因为坐标计算的关系,不能用属性变量存储,也就是每次show就必须实例化一个,否则会出现显示错误
- (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];
}
建议Rely参数加入对UIBarButtonItem的支持
还有高亮的时候 高亮没有圆角
苹果更新审核策略,需要添加PrivacyInfo.xcprivacy
应该是这一句在 iOS13 里拿不到 window #define YBMainWindow [UIApplication sharedApplication].delegate.window
改成 #define YBMainWindow [[UIApplication sharedApplication] keyWindow]
就没问题了
cell.selectionStyle = UITableViewCellSelectionStyleNone;
遇到一个问题,需要用户在TextField中,随着输入公司名称的同时,不停匹配相应的名称数据。这样子似乎会不停创建PopMenu堆积在界面上,而且titles和images数组属性也是只读的,无法设置
建议添加一个在YBPopupMenuArrowDirectionTop下,箭头为位置随意变化
我pod了0.1.2,初始化方法的 otherSettings没有了,在哪进行设置啊
没找到横向显示的属性
There's no way to programmatically dismiss a menu? How can I dismiss a menu by code? Thanks. :o)
有点不满足需求,期望能支持记录上次选中Item,不想再改源码了,否则都不能用podfile管理了
这边基于点击按钮自动判断向上弹还是向下弹,这边的一个标准是什么?按钮处于什么位置是是向下弹的?为什么我把按钮设置在了中间偏下 他也会往下弹?
在有导航栏的情况下,如果开启了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);
}];
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.