Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

有些需要完善的地方, #45

Closed
CYZZ opened this issue Jun 4, 2016 · 5 comments
Closed

有些需要完善的地方, #45

CYZZ opened this issue Jun 4, 2016 · 5 comments

Comments

@CYZZ
Copy link

CYZZ commented Jun 4, 2016

在tableViewCell点击的时候设置了,[self.tableView deselectRowAtIndexPath:indexPath animated:YES]; // 取消选中状态,在日间模式下选中到取消选中过度很流畅,但是夜间模式会有跳跃,在突然冲选中到取消;对于键盘的夜间模式:发现在夜间模式下也对textFile做了处理,感觉很不错,但是textView和searchBar没有做出相应的处理希望能够完善。还有在已经完成的项目中添加这个库,我使用的办法是在每一个控件都添加一句代码实现夜间模式,你有什么好的建议来更好的使用这个库吗?

@draveness
Copy link
Owner

draveness commented Jun 5, 2016

能详细描述一下问题么,关于这个的问题:

[self.tableView deselectRowAtIndexPath:indexPath animated:YES]

@CYZZ
Copy link
Author

CYZZ commented Jun 6, 2016

我的问题已经描述的挺清楚的了,就是小问题有点多。关于

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    // 其他代码
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; // 取消选中状态
    }
    就是想在选中cell方法时,只有在高亮状态下让cell变色,放开时取消选中。在日间模式下颜色的过度比较流畅,但是夜间模式会有卡顿跳跃的现象。
    还有就是其他的问题希望也一并解决反馈,谢谢。

@CYZZ
Copy link
Author

CYZZ commented Jun 6, 2016

我看了你的demo发现问题在于设置cell背景色的时候不同方法

  1. cell.dk_backgroundColorPicker = DKColorPickerWithKey(CELL);
  2. cell.contentView.dk_backgroundColorPicker = DKColorPickerWithKey(CELL);
    前者能正常,后者会有卡顿。

@draveness
Copy link
Owner

我试了一下,并没有你说的卡顿的问题,关于 UITextView 的支持已经添加了

@draveness
Copy link
Owner

关于选中颜色的问题,可以这么设置

- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
    [super setHighlighted:highlighted animated:animated];
    if (highlighted) {
        self.contentView.dk_backgroundColorPicker = DKColorPickerWithKey(TEXT);
    } else {
        self.contentView.dk_backgroundColorPicker = DKColorPickerWithKey(BG);
    }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants