scroll bounds 异常
SpectatorNan opened this issue · comments
spectatorMrZ commented
提交bug前:
- 请定位该bug是否由自身代码引发,当该bug模糊不清时,您应该继续思索;
- 如果您发现该bug由KafkaRefresh引发,且您能修改源码解决,欢迎您提交解决方案或提交一个request,在此先表示感谢。
提交bug必须包含下列要点:
- iOS版本;12.2
- KafkaRefresh版本(可查看cocoapods中提示的版本信息); 1.4.0
- 请您务必给出详细的重现步骤。
uiscrollview 顶部贴着屏幕, 添加headerControl ,顶部会被占用45 的高度,contentview的frame通过reveal查看 x y 均为 0,headerControl 的frame为 0,-45,375,45。 代码如上。 可判断这个空白不是 scroll 自动调整高度的64
BeatsKitano commented
是被遮挡还是什么,origin=0,-45 有问题?
spectatorMrZ commented
BeatsKitano commented
本地测试没有重现
- (void)viewDidLoad {
[super viewDidLoad];
if (@available(iOS 11, *)) {
self.scrollView.contentInsetAdjustmentBehavior = UIApplicationBackgroundFetchIntervalNever;
} else {
self.automaticallyAdjustsScrollViewInsets = false;
}
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:(UIBarMetricsDefault)];
[self.view addSubview:self.scrollView];
self.scrollView.backgroundColor = [UIColor whiteColor];
self.scrollView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
self.scrollView.contentSize = CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height*1.5);
UIView *contentView = [UIView new];
contentView.frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height*1.5);
contentView.backgroundColor = [UIColor blueColor];
[self.scrollView addSubview:contentView];
KafkaRefreshHandler headBlock = ^(void){
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.scrollView.headRefreshControl endRefreshing];
});
};
[self.scrollView bindHeadRefreshHandler:headBlock themeColor:[UIColor redColor] refreshStyle:_style];
}
- (UIScrollView *)scrollView {
if (!_scrollView) {
_scrollView = [UIScrollView new];
}
return _scrollView;
}
spectatorMrZ commented
spectatorMrZ commented
可能是在数据绑定的时候产生了什么影响, 导致headrefresh暴露出来了,将原本的view给顶下来,从而产生了空白。
BeatsKitano commented
安好!