Working with Containers

 

Containers pour a collection of widgets (and possibly child containers) into specific layouts you like. If you want a form with labels on the left and fields on the right, you will need a container. If you want OK and Cancel buttons to be beneath the rest of the form, next to one another, and flush to the right side of the screen, you will need a container. From a pure XML perspective, if you have multiple widgets (beyond widgets in a ), you will need a container just to have a root element to place the widgets inside.

Most GUI toolkits have some notion of layout management, frequently organized into containers. In Java Swing, for example, you have layout managers like and containers that use them (e.g., ). Some toolkits, such as XUL and Flex, stick strictly to the box model, figuring that any desired layout can be achieved through the right combination of nested boxes.

Android, through , also offers a box model, but in addition it supports a range of containers providing different layout rules. In this chapter we will look at three commonly used containers: (the box model), (a rule‑based model), and (the grid model), along with , a container designed to assist with implementing scrolling containers. In the next chapter we will examine some more‑esoteric containers.

 








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


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

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

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

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