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

searchSuggestionVC的frame问题 #74

Open
coder-glzhu opened this issue Apr 6, 2017 · 4 comments
Open

searchSuggestionVC的frame问题 #74

coder-glzhu opened this issue Apr 6, 2017 · 4 comments

Comments

@coder-glzhu
Copy link

1.如果用自己的navController时候,你设置searchSuggestionVC的y为64,会导致界面向下偏移64。这问题让我找了好久,我还以为是自己写的导航栏有问题。
2.PYSearchSuggestionViewController的Cell 允许自定义就好了。
3.点击PYSearchSuggestionViewController的cell,可以把回调公开出去。
这是本人一点小建议,希望作者考虑一下哈

@ko1o
Copy link
Owner

ko1o commented Apr 6, 2017

@GL-ZHU 首先谢谢你的反馈。

  1. searchSuggestionVC的y值为64是我内部的处理。

  2. 关于自定义搜索建议 可以通过设置searchViewController的dataScource实现,如下

@protocol PYSearchSuggestionViewDataSource <NSObject, UITableViewDataSource>

@required
/** 返回用户自定义搜索建议Cell */
- (UITableViewCell *)searchSuggestionView:(UITableView *)searchSuggestionView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
/** 返回用户自定义搜索建议cell的rows */
- (NSInteger)searchSuggestionView:(UITableView *)searchSuggestionView numberOfRowsInSection:(NSInteger)section;
@optional
/** 返回用户自定义搜索建议cell的section */
- (NSInteger)numberOfSectionsInSearchSuggestionView:(UITableView *)searchSuggestionView;
/** 返回用户自定义搜索建议cell高度 */
- (CGFloat)searchSuggestionView:(UITableView *)searchSuggestionView heightForRowAtIndexPath:(NSIndexPath *)indexPath;

@end
  1. 关于点击PYSearchSuggestionViewController的cell的问题,我知道大部分的需求可能是获得相关模型,这个完全可以通过获取的index得到 如下,如果你有特殊的需求,还望告知。
/** 点击搜索建议时调用,如果实现该代理方法则点击搜索建议时searchViewController:didSearchWithsearchBar:searchText:失效 */
- (void)searchViewController:(PYSearchViewController *)searchViewController didSelectSearchSuggestionAtIndex:(NSInteger)index searchText:(NSString *)searchText 

@coder-glzhu
Copy link
Author

谢谢你。关于自定义cell的问题,是因为我pod下来的代码是旧版本,没有这些dataScource。

@ko1o
Copy link
Owner

ko1o commented Apr 6, 2017

@GL-ZHU 可以先更新本地仓库。 最新版本参照README.md里面的显示,目前最新是0.7.5!

@zhaomengshan
Copy link

这个我也遇到了,但是不知道怎么解决啊,就是热门搜索往上弹了64

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

3 participants