Android Programming for Beginners
上QQ阅读APP看书,第一时间看更新

Exploring Android UI design

We will see with Android UI design that so much of what we learn is context sensitive. The way that a given widget's x property will influence its appearance might depend on a widget's y property. It probably isn't possible to learn this verbatim. It is most likely best to expect to gradually get better and faster results with practice.

For example, if you play with the designer by dragging and dropping widgets onto the design, the XML code that is generated will vary quite extensively depending upon which layout type you are using. This is because different layout types use different means to determine the position of their children. We will see this, perhaps most distinctly, when we look at RelativeLayout later in the chapter.

This information might initially seem like a problem, or a bad idea, and it certainly is a little awkward at first. What we will grow to learn, however, is that this apparent abundance of layout options and their individual quirks are actually a good thing because they give us almost unlimited design potential. There are very few layouts you can imagine that are not possible to achieve.

This unlimited potential comes with a bit of complexity however. So, rather than a few step-by-step examples that lack explanation, I thought a three-pronged approach would be worthwhile. A bit of theory, a bit of experimenting, and finally some practical examples. This chapter deals with theory and experimenting, and in the next chapter, we'll deal with the practical examples.