ko1o / PYSearch

🔍 An elegant search controller which replaces the UISearchController for iOS (iPhone & iPad) .
MIT License
3.83k stars 752 forks source link

历史记录清空按钮显示bug #186

Open Tiger9527 opened 6 years ago

Tiger9527 commented 6 years ago

在没有热门搜索的情况下,初始化搜索vc,历史记录清空按钮不显示,取消后显示

screen shot 2018-08-27 at 2 39 58 pm screen shot 2018-08-27 at 2 40 08 pm
chenzenghui2013 commented 5 years ago

我也遇到这个问题
不知道如何修改

ko1o commented 5 years ago

@Tiger9527 @chenzenghui2013 更新到最新版试试 我这边测试没问题

XiaoYiS commented 5 years ago

第一次present进去之后,emptyButton不显示,当搜索过后(点击或者输入)再回到搜索页面才会显示呢, @ @ko1o ,最新版本

XiaoYiS commented 5 years ago

@chenzenghui2013 @Tiger9527 @ko1o 这个解决了吗,支一招呗

ko1o commented 5 years ago

@XiaoYiS @chenzenghui2013 @Tiger9527 试试最新版哈 如果还是不行的话,直接加我QQ:499491531

GongCheng12138 commented 5 years ago

最新版还是没有用啊 老哥

ko1o commented 5 years ago

@GongCheng12138 @Tiger9527 @chenzenghui2013 @XiaoYiS 我这边用最新版测试是没问题的 麻烦检查下是不是最新版 最好是 直接使用clone 下载项目 测试

liuliangju commented 5 years ago

还是有问题 @ko1o

lizhongkan commented 3 years ago

也是发现,还是存在这个问题。iOS 13测试。

lizhongkan commented 3 years ago

发现emptyButton在创建的时候,searchHistoryView,headerView还没有创建,导致emptyButton没有添加成功。 创建PYSearchViewController sc时,重置一次: if (!sc.emptyButton.superview) { sc.emptyButton = nil; }

gaoqh commented 3 years ago

我在懒加载searchHistoryView和emptyButton方法里,都添加了父控件的判断 if (!_searchHistoryView && self.headerView) { UIView searchHistoryView = [[UIView alloc] init]; searchHistoryView.py_x = self.hotSearchView.py_x; searchHistoryView.py_y = self.hotSearchView.py_y; searchHistoryView.py_width = self.headerView.py_width - searchHistoryView.py_x 2; searchHistoryView.autoresizingMask = UIViewAutoresizingFlexibleWidth; [self.headerView addSubview:searchHistoryView]; _searchHistoryView = searchHistoryView; }