Structure of a UI design
When we create a new project, Android Studio creates a new layout for us. As we have seen, this autogenerated layout is very simple and contains a single TextView
widget. The TextView
widget is unsurprisingly the standard way of displaying text. On the palette it is labeled as Plain TextView but in XML code it just says TextView
. I will refer to it in the way that seems most appropriate for the current context.
Tip
It will become apparent as we progress, but it is worth making clear at this point that all our layouts will be designed in XML, not Java. In later chapters, you will learn more Java and then we will see how we write Java code to manipulate these layouts.
What we haven't looked at quite as closely is that the generated activity_main.xml
file also contains a layout. Layouts come in a few different types and the one that is provided with our auto-generated layout is called RelativeLayout
. Here is the XML that makes this layout:
<RelativeLayout xmlns...