The Idiosyncrasies

 

There are a few rules to follow, at least in this milestone edition of the Android toolkit, in order to make these three work together:

• You mus t give the an of .

• You must set aside some padding in the for the tab buttons.

• If you wish to use the , you must give the an of .

, like , wraps a common UI pattern (activity made up entirely of tabs) into a pattern‑aware activity subclass. You do not necessarily have to use – a plain activity can use tabs as well.

With respect to the padding issue, for whatever reason, the does not seem to allocate its own space inside the container. In other words, no matter what you specify for android:layout_height for the , the ignores it and draws at the top of the overall . Your tab contents obscure your tab buttons. Hence, you need to leave enough padding (via ) in to “shove” the actual tab contents down beneath the tab buttons.

In addition, the seems to always draw itself with room for icons, even if you do not supply icons. Hence, for this version of the toolkit, you need to supply at least 62 pixels of padding, perhaps more depending on the icons you supply.

For example, here is a layout definition for a tabbed activity, from :

 

Note that the and are immediate children of the , and the itself has children representing the various tabs. In this case, there are two tabs: a clock and a button. In a more complicated scenario, the tabs are probably some form of container (e.g., ) with their own contents.

 








Дата добавления: 2015-05-16; просмотров: 661;


Поиск по сайту:

При помощи поиска вы сможете найти нужную вам информацию.

Поделитесь с друзьями:

Если вам перенёс пользу информационный материал, или помог в учебе – поделитесь этим сайтом с друзьями и знакомыми.
helpiks.org - Хелпикс.Орг - 2014-2024 год. Материал сайта представляется для ознакомительного и учебного использования. | Поддержка
Генерация страницы за: 0.004 сек.