lifution / fspopoverview Goto Github PK
View Code? Open in Web Editor NEWAn iOS customizable view that displays a popover view.
License: MIT License
An iOS customizable view that displays a popover view.
License: MIT License
如果我点选了某一行。再次打开的时候,cell中没有标识我之前选择的哪一个,虽然是个小功能,但是可以扩展下,设置个属性是否开启标识,如果开启,那么给一些标识的枚举,打对勾、文字图标变色...等等。
封装得很好!
但需求这个东西~~呵呵,你懂的
我花了一些时间,进行了改造,不知道作者能不能有更好的办法实现. 就是在鼠标按住cell的时候,有一个高亮效果(highLight). (我只是按照项目需求进行了,相应改造,以达到项目中要求的效果;但暂时还没有用于项目中)
(void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
[super setHighlighted:highlighted animated:animated];
if (highlighted) {
// self.backgroundColor = _style == PopoverViewStyleDefault ? [UIColor colorWithRed:0.90 green:0.90 blue:0.90 alpha:1.00] : [UIColor colorWithRed:0.23 green:0.23 blue:0.23 alpha:1.00];
self.backgroundColor = [UIColor orangeColor];
self.contentView.backgroundColor = self.backgroundColor;
[_button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
NSString *highLightImageString = [NSString stringWithFormat:@"%@_highLight",self.action.imageString];
[_button setImage:[UIImage imageNamed:highLightImageString] forState:UIControlStateNormal];
} else {
[UIView animateWithDuration:0.3f animations:^{
// self.backgroundColor = [UIColor clearColor];
self.backgroundColor = [UIColor colorWithRed:33/255.0 green:44/255.0 blue:53/255.0 alpha:0.0];
self.contentView.backgroundColor = self.backgroundColor;
[_button setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
[_button setImage:[UIImage imageNamed:self.action.imageString] forState:UIControlStateNormal];
}];
}
}
另外一个需求,有时候actions的个数一开始是不确定,需要请求完成,才知道个数的;并且个数有可能很多,需要tableView滚动.作者是否会考虑扩展呢.
RT
Item.selectorHandler is giving item, but i need selected Index. As shown above image i am using stores which is a [String]. We are showing stores name in list and store name can be same so i was wondering if there's any way to get the selected Index from the selectedHandler Closure.
I have tried to set the tag property but couldn't find any object on which i can set it.
Any help will be appreciated. Thank you!
在 Test1ViewController 中弹出 PopoverView,
选中 PopoverView 的 item 之后 push 到 Test2ViewController (Test2ViewController 的 viewDidLoad 中 调用了 [SVProgressHUD show]; )
但是 SVProgressHUD 却无法显示。
Is there a plan?
PopoverAction *action1 = [PopoverAction actionWithTitle:@"Title" handler:^(PopoverAction *action) { // 该Block不会导致内存泄露, Block内代码无需刻意去设置弱引用. }];
此注释有误,PopoverAction持有Block,PopoverView持有actions,actions持有PopoverAction,进而PopoverView持有Block,若此Block中持有某个控制器self,self持有PopoverView,或者此Block中持有PopoverView,则会造成循环引用。PopoverView代码中含有_actions = nil;
的片段,但是没有覆盖全部场景,当点击浮层hide的时候,并没有_actions = nil;
,则导致PopoverView造成内存泄漏。
bug:iOS11下视图底部多出一些空白区域
我本身点击的时候,就是一个悬浮按钮,这时候弹出的视图会有问题,是因为我之前的window视图影响吗?
解决方式:
需要适配一下气泡列表,tableView 在横屏下,默认会做安全区域适配。
在 tableView 初始化那里加多下面一句代码即可完美显示。
if (@available(iOS 11.0, *)) {
_tableView.insetsContentViewsToSafeArea = NO;
}
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.