ios 如何在 iPhone 的 UIScrollview 中隐藏/删除滚动条?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9837003/
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-30 17:30:33  来源:igfitidea点击:

How to hide/remove the scrollbar in UIScrollview in iPhone?

iosiphoneobjective-cuiscrollviewhide

提问by surendher raja

Possible Duplicate:
Is there a way to hide the scroll indicators in an UIScrollView?

可能的重复:
有没有办法在 UIScrollView 中隐藏滚动指示器?

I am using the UIScrollview in my project.

我在我的项目中使用 UIScrollview。

In this I don't want scroll bar. I want it to hide or remove from the UIScrollview.

在这我不想要滚动条。我希望它从 UIScrollview 中隐藏或删除。

Any help will be appreciated.

任何帮助将不胜感激。

回答by Azik Abdullah

Use

[scrollview setShowsHorizontalScrollIndicator:NO];
[scrollview setShowsVerticalScrollIndicator:NO];

Swift

迅速

scrollView.showsHorizontalScrollIndicator = false 
scrollView.showsVerticalScrollIndicator = false

回答by Mick MacCallum

You need to set following properties for UIScrollView to NO.

您需要将 UIScrollView 的以下属性设置为NO.

1) setShowsHorizontalScrollIndicator:

1) setShowsHorizontalScrollIndicator:

2) setShowsVerticalScrollIndicator:

2) setShowsVerticalScrollIndicator:

[myScrollView setShowsHorizontalScrollIndicator:NO];
[myScrollView setShowsVerticalScrollIndicator:NO];

Hope this helps you.

希望这对你有帮助。