10

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

I am using the UIScrollview in my project.

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

Any help will be appreciated.

Community
  • 1
  • 1
surendher raja
  • 203
  • 1
  • 2
  • 6

2 Answers2

66

Use

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

Swift

scrollView.showsHorizontalScrollIndicator = false 
scrollView.showsVerticalScrollIndicator = false
Nazik
  • 8,696
  • 27
  • 77
  • 123
  • Swift scrollView.showsHorizontalScrollIndicator = false scrollView.showsVerticalScrollIndicator = false – DoesData Jul 19 '17 at 00:34
  • There are also tick boxes for this in the "Attributes inspector" in the "Indicators" section (in Xcode 12.4 this is the first one). – Neph Mar 15 '21 at 13:23
6

You need to set following properties for UIScrollView to NO.

1) setShowsHorizontalScrollIndicator:

2) setShowsVerticalScrollIndicator:

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

Hope this helps you.

Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281
  • 8
    If only Apple provided some kind of list of all of these methods so you could search them and see what they do rather than having to post a question and then wait for someone to answer it..... – Nick Bull Mar 23 '12 at 09:56
  • @MDT: You say it is quicker to ask here. But then you can always imagine the number of similar or duplicate questions occurring everyday as per your logic as sometimes posting a question here gets you faster answer than even Googling in some cases. In that case everyday data management because of huge number of questions everyday makes the job of the moderators really very tough. So please help the community be better and more cleaner as far as data management goes. Nothing personal. Thanks! – Parth Bhatt Mar 23 '12 at 12:41
  • @MDT: Yes you are right but you being an old member of StackOverflow, I feel we can expect you to flag things which you find a duplicate of. Nothing personal Thanks Again! :) – Parth Bhatt Mar 23 '12 at 16:20