Did you ever wonder where your scroll bars went? Maybe you don't think about it much, but before OS X Lion, scroll bars were all the rage. Then Apple decided to go for a cleaner look, and made them disappear. But, you can get them back if you'd like, and even control exactly when they'll appear.
In this Tutor Tip we look at how we can always show the scroll bar in a window in macOS. On Mac the scroll bars can be hidden and only have them show when you scroll the page so you can see the current scroll position. The idea is that a touch pad is used that doesn't require the scroll bars to be visible and thus have more screen estate for the browsing area.
Bringing Back the Scroll Bars in Apps in OS X
First, open System Preferences, and then click on 'General' in the Preferences window. (It's likely in the upper left-hand corner.)
When the 'General' screen appears, you'll see the 'Show scroll bars' section about a third of the way down the screen.
Here, you'll see three options for showing scroll bars:
- 'Automatically based on mouse or trackpad': If this is clicked, the scroll bars will show up when you have a mouse connected to your Mac, but the will remain hidden when you're using a trackpad.
- 'When scrolling': This option only shows the scroll bars when you're scrolling. So, no matter if you're using a mouse or a trackpad, you'll only see the scroll bars when you're scrolling up or down through a page.
- 'Always': This is my favorite, and it's how I scroll. Scroll bars always show when this is selected, so you can scroll using the trackpad or mouse sensor, or you can click or grab the scroll bar to scroll.
Page Jump Control
While we're here, we might as well look at the section to control how the pages react when you click above or below the scroll bar. You'll find these options just below the 'Show scroll bars' section, and it's marked: 'Click in the scroll bar to:'
In this section you have two options:
- 'Jump to the next page': If you click above or below the scroll bar you just made visible above, the page will jump to the page either above or below the current position, depending on where you click the scroll bar. I have my Mac set to this, as it makes it easy to jump from page to page, and quickly skim through a document until I find what I'm looking for.
- 'Jump to the spot that's clicked': The page will jump to the section of the page that corresponds to where you clicked on the scroll bar. So, if you click the top of the scroll bar, the view will jump to the top of the page, click the bottom, you'll see the bottom of the page. (And anywhere in between.)
Mac Scroll Bar Not Working
By turning on the scroll bars in OS X, you allow yourself a little more flexibility in how you can navigate through a document, or web page. Try it and see if it doesn't make more sense to leave it on. Design gods be damned.
Scroll Views
A scroll view allows users to browse content, such as text in a document or a collection of images, that's larger than the visible area. As people swipe, flick, drag, tap, and pinch, a scroll view follows the gesture, revealing or zooming content in a way that feels natural. A scroll view itself has no appearance, but does display transient scrolling indicators as people interact with it. A scroll view can also be configured to operate in paging mode, where scrolling reveals an entirely new page of content rather than moving around the current page.
Support zoom behavior appropriately. If it makes sense in your app, let people pinch or double-tap to zoom in and out. When you enable zoom, set maximum and minimum scale values that make sense. For example, zooming in on text until a single character fills the screen probably doesn't make sense in most apps.
Consider showing a page control element when a scroll view is in paging mode. A page control shows how many pages, screens, or other chunks of content are available and indicates which one is currently visible. If you show a page control with a scroll view, disable the scrolling indicator on the same axis to avoid confusion. For additional guidance, see Page Controls.
Don't place a scroll view inside of another scroll view. Doing so creates an unpredictable interface that's difficult to control.
Show Scroll Bars Mac
In general, display one scroll view at a time. People often make large swipe gestures when scrolling, and it can be hard to avoid interacting with a neighboring scroll view on the same screen. If you need to put two scroll views on one screen, consider allowing them to scroll in different directions so one gesture is less likely to affect both views. For example, when an iPhone is in portrait orientation, the Stocks app shows stock quotes that scroll vertically above company-specific information that scrolls horizontally.
For developer guidance, see UIScrollView.