Translations:Android Training/Building a Simple User Interface/5/en: Unterschied zwischen den Versionen
(Neue Version von externer Quelle importiert) |
(kein Unterschied)
|
Version vom 16. Dezember 2015, 19:56 Uhr
Create a Linear Layout
- In Android Studio, from the
res/layout
directory, open theactivity_my.xml
file.- The BlankActivity template you chose when you created this project includes the
activity_my.xml
file with a RelativeLayout root view and aTextView
child view.
- The BlankActivity template you chose when you created this project includes the
- In the Preview pane, click the Hide icon to close the Preview pane.
- In Android Studio, when you open a layout file, you’re first shown the Preview pane. Clicking elements in this pane opens the WYSIWYG tools in the Design pane. For this lesson, you’re going to work directly with the XML.
- Delete the
<TextView>
element. - Change the
<RelativeLayout>
element to<LinearLayout>
. - Add the
android:orientation
attribute and set it to"horizontal"
. - Remove the
android:padding
attributes and thetools:context
attribute.