CoderMJLee / MJRefresh

An easy way to use pull-to-refresh.
MIT License
13.79k stars 3.55k forks source link

iOS9 tableviewheader为searchbar的时候下拉时显示有问题 #431

Closed JinWuZhao closed 4 years ago

JinWuZhao commented 8 years ago

如下图 pull-down-issue

JinWuZhao commented 8 years ago

发现貌似和屏幕大小有关,模拟器上iphone4是正常的,5以上都不正常,

JinWuZhao commented 8 years ago

ios7 iphone4真机上也不正常

CoderMJLee commented 8 years ago

就是滚动条会飘来飘去?

JinWuZhao commented 8 years ago

下拉的时候也看不到上方的提示文字

horsley commented 8 years ago

下拉的时候也看不到上方的提示文字 我这边也遇到这个问题

Ailix commented 8 years ago

数据不满一屏时mj_footer也偏到底部去了

JinWuZhao commented 8 years ago

下拉看不到提示文字的问题我找到解决方案了,把mj_header的初始化放到viewDidLoad里面就好了。原来的时候我放在了一个回调里,要延迟一会才初始化

horsley commented 8 years ago

@JinWuZhao 我的初始化也在viewDidLoad 依然有下拉看不到文字问题

ClegeJJ commented 8 years ago

同求这个问题..

tableView.tableheaderView = searchController.searchBar

就会为tableview加一个UIView 是自动伸缩的 正好挡住MJHeaderView

ClegeJJ commented 8 years ago
2016-03-08 4 50 27

RT所示

ClegeJJ commented 8 years ago
2016-03-08 4 54 23

突然看到上面的答案 解决了- -..

先给tableview.mj_header 添加控件 再给tableview.tableheaderView添加searchbar就没有问题 ...

不过还是请教下MJ老师- - ...为什么searchcontroller会莫名其妙给tableview加一个遮挡的view...

我加了您微信的 ~ 微信号 : qinxin_Pis

希望有空和MJ探讨学习~~

KayonYang commented 8 years ago

@Ailix mj_footer加了seachbar后跑到底部怎么让他跑上来

hbxn740150254 commented 8 years ago

@Ailix @KayonYang 解决 tableheaderView 为 UISearchBar 时候,数据不满一屏,mj_footer文字一直在底部的问题,方案如下 包装一下UISearchBar 即可 UIView *view = [[UIView alloc] initWithFrame:(CGRect){0,0,SCREEN_WIDTH,44}]; [view addSubview:searchBar]; self.tableView.tableHeaderView = view;

gonghonglou commented 7 years ago

杰哥,求指教MJRefresh一个问题: tableView.tableHeaderView = searchController.searchBar; 时,tableView下拉出来的背景会变成更深一点的颜色,这时候mj_header就会有半截视图显示出来非常 ugly 啊。我现在的做法是

UIView *searchView = [UIView new];
[searchView addSubview:searchController.searchBar];
searchView.frame = CGRectMake(0, 0, self.view.frame.size.width, 44);
tableView.tableHeaderView = searchView;

但是这样有两个问题: 1、横竖屏时searchBar的宽度不变 2、下拉刷新时mj_header会闪一下一道黑线

该怎么解决呢? 或者tableHeaderView为searchBar时,怎么样令下拉出来的背景色和tableView的背景色保持一致呢?

wechatimg2