会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
樊特西style
博客园
首页
新随笔
联系
管理
订阅
iOS 11 下 UICollectionView 的HeaderView 遮挡滚动条
这个问题在之前的 iOS 10 上是没有的,iOS 11 新出之后才出现。在使用了- collectionView: viewForSupplementaryElementOfKind: atIndexPath:的 UICollectionView 页面中,滑动页面的时候滚动条会被 HeaderView 遮挡.
#import
"CustomCollectionReusableView.h"
#ifdef __IPHONE_11_0
@interface
CustomLayer :
CALayer
@end
#endif
@interface
CustomCollectionReusableView ()
@property (
nonatomic,
strong)
UILabel *showLabel;
/**< 显示控件 */
@end
#ifdef __IPHONE_11_0
@implementation
CustomLayer - (
CGFloat) zPosition {
return
0; }
@end
#endif
@implementation
CustomCollectionReusableView
- (
void)layoutSubviews {
[
super layoutSubviews];
[
self _setUpSubViews];
}
- (
void)_setUpSubViews {
[
self addSubview:
self.showLabel];
}
#pragma mark - Lazy
- (
UILabel *)showLabel{
if (!_showLabel) {
_showLabel = [[
UILabel alloc] initWithFrame:
CGRectMake(
20,
20,
120,
self.frame.size.height)];
_showLabel.font = [
UIFont systemFontOfSize:
13];
_showLabel.textAlignment =
NSTextAlignmentLeft;
_showLabel.backgroundColor = [
UIColor clearColor];
_showLabel.textColor = [
UIColor redColor]; }
return _showLabel;
}
#ifdef __IPHONE_11_0
+ (Class)layerClass {
return [CustomLayer
class];
}
#endif
@end
posted @
2018-05-16 09:36
樊特西style
阅读(
1041
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部
公告