236 CHAPTER 7: Making Apps Interactive: Intents, Event Handling, and Menus
The next four parameters allow you to align your UI widgets relative to the parent UI layout
container, and the ones listed after those will allow you to center your UI widgets, relative to their
parent UI layout container. As you might well imagine, when all of these parameters are utilized
together in conjunction inside of each of your component UI design widgets, you can achieve just
about any UI layout design result that you can imagine.
What is really powerful about RelativeLayout is that when your user changes their Android hardware
device’s orientation from portrait (up and down, or vertical) to landscape (side to side, or
horizontal), your relative layout design can “morph” to conform to the new display screen shape!
Let’s start learning about some of these relative layout parameters!
Since we want our
This will make sure that the
two UI elements attractively, nor will it position your UI elements in the Y axis (above or below)
dimension, only within the X axis (side to side) dimension. This is why a number of RelativeLayout
positioning and alignment parameters must be utilized in conjunction with one another in order to
achieve a fine-tuned and professional UI layout design result.
Figure 7-18. Add the RelativeLayout parameter android:layout_toRightOf inside the