ios 如何隐藏 UICollectionView 的滚动条

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30836571/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 06:25:26  来源:igfitidea点击:

How to hide scroll bar of UICollectionView

iosuicollectionview

提问by TIANLAOBA

I m working on a UICollectionViewclass, and it will display the scroll bar when I scroll on the list, it's possible to hide scroll bar when scrolling?

我正在研究一个UICollectionView类,当我在列表上滚动时它会显示滚动条,滚动时可以隐藏滚动条吗?

回答by Tejas Ardeshna

Objective C:

目标 C:

 [collectionView setShowsHorizontalScrollIndicator:NO];
 [collectionView setShowsVerticalScrollIndicator:NO];

Swift 3.0

斯威夫特 3.0

colView.showsHorizontalScrollIndicator = false
colView.showsVerticalScrollIndicator = false

From storyboard:

从故事板:

enter image description here

在此处输入图片说明

回答by rgreso

in Swift:

在斯威夫特:

collectionView.showsHorizontalScrollIndicator = false

in Interface Builder: enter image description here

在界面生成器中: 在此处输入图片说明