Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

封装得很好! 提需求的哦~~ #2

Closed
zzdota opened this issue Jun 30, 2017 · 3 comments
Closed

封装得很好! 提需求的哦~~ #2

zzdota opened this issue Jun 30, 2017 · 3 comments

Comments

@zzdota
Copy link

zzdota commented Jun 30, 2017

封装得很好!

但需求这个东西~~呵呵,你懂的
我花了一些时间,进行了改造,不知道作者能不能有更好的办法实现. 就是在鼠标按住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滚动.作者是否会考虑扩展呢.
demo 1

@lifution
Copy link
Owner

lifution commented Jun 30, 2017

@zzdota 这个控件是用在 iOS 上的, 你这是放在 Mac 上了么 ? 😂 Mac 上貌似有专门的这种控件吧. 😀

@zzdota
Copy link
Author

zzdota commented Jun 30, 2017

归档 2.zip

是用在iPhone上的;
前面2张图片是项目目前的实现方法,可以滚动,有点想改掉的.
最后一张图片就是在作者你的demo上改造了的.

有个建议,还有很多属性比如说 各种颜色,箭头的高度,箭头的弧度数等,这些属性都是可以调节的.(实际上我也是改了试了一下的). 你这么辛苦写出来,目的就是让别人用的时候,方便,简洁,用得爽. 虽然这些属性都是小东西,但也能体现,使用的时候的便捷性,可定制性. ~~

@lifution
Copy link
Owner

好的, 谢谢你的建议, 有空的话我会再改进一下, 尽量能方便使用者定制风格. 😁

@lifution lifution closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants