blob: 5a5da5d8ad9706885eaeab79a24e197a49ee9f25 [file] [log] [blame]
Roman Nurikb99ae732012-03-06 12:26:15 -08001page.title=Tabs
Scott Main64d51032013-04-12 14:00:30 -07002page.tags="tabs","actionbar","navigation","viewpager"
Roman Nurikb99ae732012-03-06 12:26:15 -08003@jd:body
4
5<img src="{@docRoot}design/media/tabs_overview.png">
6
Scott Maincbcd17d2013-05-14 08:46:55 -07007<a class="notice-developers" href="{@docRoot}training/implementing-navigation/lateral.html">
8 <div>
9 <h3>Developer Docs</h3>
10 <p>Creating Swipe Views with Tabs</p>
11 </div>
12</a>
13
Roman Nurikb99ae732012-03-06 12:26:15 -080014<p>Tabs in the action bar make it easy to explore and switch between different views or functional
15aspects of your app, or to browse categorized data sets.</p>
16
Peter Ng252d23d2012-08-07 20:19:10 -070017<p>For details on using gestures to move between tabs, see the <a href="{@docRoot}design/patterns/swipe-views.html">Swipe Views</a> pattern.</p>
Roman Nurikb99ae732012-03-06 12:26:15 -080018
19<h2 id="scrollable">Scrollable Tabs</h2>
20
21
22<div class="layout-content-row">
23 <div class="layout-content-col span-6">
24
25<p>Scrolling tab controls can contain a larger number of items than a standard tab control. To navigate
26to the next/previous view, swipe left or right.</p>
27
28 </div>
29 <div class="layout-content-col span-7">
30
31 <video width="400" class="with-shadow play-on-hover" autoplay>
32 <source src="{@docRoot}design/media/tabs_scrolly.mp4" type="video/mp4">
33 <source src="{@docRoot}design/media/tabs_scrolly.webm" type="video/webm">
34 <source src="{@docRoot}design/media/tabs_scrolly.ogv" type="video/ogg">
35 </video>
36 <div class="figure-caption">
Roman Nurikb20f1202012-03-29 13:28:13 -070037 Scrolling tabs in the Play Store app.
Dirk Dougherty0b734032013-10-19 11:43:41 -070038 <div class="video-instructions-image">&nbsp;</div>
Roman Nurikb99ae732012-03-06 12:26:15 -080039 </div>
40
41 </div>
42</div>
43
44
45<h2 id="fixed">Fixed Tabs</h2>
Peter Ng252d23d2012-08-07 20:19:10 -070046<p>Fixed tabs display all items concurrently. To navigate to a different view, touch the tab, or swipe left or right.</p>
Peter Ng02123632012-08-06 11:44:48 -070047<p>Fixed tabs are displayed with equal width, based on the width of the widest tab label. If there is insufficient room to display all tabs, the tab labels themselves will be scrollable. For this reason, fixed tabs are best suited for displaying 3 or fewer tabs.</p>
Roman Nurikb99ae732012-03-06 12:26:15 -080048
49<img src="{@docRoot}design/media/tabs_standard.png">
50<div class="figure-caption">
51 Tabs in Holo Dark &amp; Light.
52</div>
53
54<img src="{@docRoot}design/media/tabs_youtube.png">
55<div class="figure-caption">
Scott Maine04c4542013-06-18 21:16:25 -070056 Tabs in the Google Play Movies app.
Roman Nurikb99ae732012-03-06 12:26:15 -080057</div>