Zum Inhalt springen

Android Training/Building a Simple User Interface/de: Unterschied zwischen den Versionen

Die Seite wurde neu angelegt: „== Ein Lineares Layout erstellen == # Öffne in Android Studio die Datei <code>activity_my.xml</code> aus dem Ordner <code>res/layout</code> #: Die BlankActivi…“
(Die Seite wurde neu angelegt: „Hier sind die <EditText> Attribute, welche du hinzugefügt hast:“)
(Die Seite wurde neu angelegt: „== Ein Lineares Layout erstellen == # Öffne in Android Studio die Datei <code>activity_my.xml</code> aus dem Ordner <code>res/layout</code> #: Die BlankActivi…“)
Zeile 9: Zeile 9:
<code>Layouts</code> sind Subklassen von <code>ViewGroup</code>. In dieser Übung arbeitest du mit <code>LinearLayout</code>.
<code>Layouts</code> sind Subklassen von <code>ViewGroup</code>. In dieser Übung arbeitest du mit <code>LinearLayout</code>.


== Create a Linear Layout ==
== Ein Lineares Layout erstellen ==
# In Android Studio, from the <code>res/layout</code> directory, open the <code>activity_my.xml</code> file.
# Öffne in Android Studio die Datei <code>activity_my.xml</code> aus dem Ordner <code>res/layout</code>
#: 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.
#: Die BlankActivity Vorlage, die du beim Erstellen des Projektes ausgewählt hast, enthält die Datei <code>activity_my.xml</code> mit einem RelativeLayout Basis-View und beinhaltet eine <code>TextView</code>.
# In the Preview pane, click the Hide icon  to close the Preview pane.
# Klicke das Verstecken-Icon im Vorschau-Bereich, um diesen zu verbergen.
# 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.
# In ANdroid Studio siehst du beim Öffnen einer Layout-Datei zuerst den Vorschaubereich. Beim Klicken auf ein Element in dieser Ansicht werden die WYSIWYG Tools im Design-Bereich geöffnet. In dieser Übung wirst du direkt mit dem XML arbeiten.
# Delete the [http://developer.android.com/reference/android/widget/TextView.html <code><TextView></code>] element.
# Lösche das [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>].
# Ändere das [http://developer.android.com/reference/android/widget/RelativeLayout.html <code><RelativeLayout></code>] zu einem [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>.
# Füge das [http://developer.android.com/reference/android/widget/LinearLayout.html#attr_android:orientation <code>android:orientation</code>]-Attribut hinzu und setze den Wert auf <code>"horizontal"</code>.
# Remove the <code>android:padding</code> attributes and the <code>tools:context</code> attribute.
# Entferne das <code>android:padding</code>- und <code>tools:context</code>-Attribut.


Das Ergebnis sieht wie folgt aus:
Das Ergebnis sieht wie folgt aus:
11.008

Bearbeitungen

Cookies helfen uns bei der Bereitstellung von Android Wiki. Durch die Nutzung von Android Wiki erklärst du dich damit einverstanden, dass wir Cookies speichern.