Translations:Android Training/Building a Simple User Interface/5/en: Unterschied zwischen den Versionen

Aus Android Wiki
(Neue Version von externer Quelle importiert)
 
K (FuzzyBot verschob die Seite Translations:Android Training/Eine einfache Benutzeroberfläche erstellen/5/en nach Translations:Android Training/Building a Simple User Interface/5/en, ohne dabei eine Weiterleitung anzulegen: Teil der übersetzbare…)
 

Aktuelle Version vom 18. Dezember 2015, 03:24 Uhr

Nachricht im Original (Android Training/Building a Simple User Interface)
== Create a Linear Layout ==
# In Android Studio, from the <code>res/layout</code> directory, open the <code>activity_my.xml</code> file.
#: The BlankActivity template you chose when you created this project includes the <code>activity_my.xml</code> file with a RelativeLayout root view and a <code>TextView</code> child view.
# 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 [http://developer.android.com/reference/android/widget/TextView.html <code><TextView></code>] element.
# Change the [http://developer.android.com/reference/android/widget/RelativeLayout.html <code><RelativeLayout></code>] element to [http://developer.android.com/reference/android/widget/LinearLayout.html <code><LinearLayout></code>].
# Add the [http://developer.android.com/reference/android/widget/LinearLayout.html#attr_android:orientation <code>android:orientation</code>] attribute and set it to <code>"horizontal"</code>.
# Remove the <code>android:padding</code> attributes and the <code>tools:context</code> attribute.

Create a Linear Layout[Quelltext bearbeiten]

  1. In Android Studio, from the res/layout directory, open the activity_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 a TextView child view.
  2. In the Preview pane, click the Hide icon to close the Preview pane.
  3. 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.
  4. Delete the <TextView> element.
  5. Change the <RelativeLayout> element to <LinearLayout>.
  6. Add the android:orientation attribute and set it to "horizontal".
  7. Remove the android:padding attributes and the tools:context attribute.