Bearbeiten von „Android Training/Building a Simple User Interface

Du bearbeitest die Quelle einer übersetzbaren Seite. Bitte stelle sicher, dass du mit der folgenden Dokumentation vertraut bist:

Warnung: Du bist nicht angemeldet. Deine IP-Adresse wird bei Bearbeitungen öffentlich sichtbar. Melde dich an oder erstelle ein Benutzerkonto, damit Bearbeitungen deinem Benutzernamen zugeordnet werden. Ein eigenes Benutzerkonto hat eine ganze Reihe von Vorteilen.

Die Bearbeitung kann rückgängig gemacht werden. Bitte prüfe den Vergleich unten, um sicherzustellen, dass du dies tun möchtest, und veröffentliche dann unten deine Änderungen, um die Bearbeitung rückgängig zu machen.

Aktuelle Version Dein Text
Zeile 1: Zeile 1:
<languages/>
<languages />
[[Datei:Viewgroup.png|thumb|<translate><!--T:37-->
[[Datei:Viewgroup.png|thumb|Illustration of how ViewGroup objects form branches in the layout and contain View objects.]]
Illustration of how ViewGroup objects form branches in the layout and contain View objects.</translate>]]
<translate><!--T:1-->
<translate><!--T:1-->
In this lesson, you create a layout in XML that includes a text field and a button. In the next lesson, your app responds when the button is pressed by sending the content of the text field to another activity.
In this lesson, you create a layout in XML that includes a text field and a button. In the next lesson, your app responds when the button is pressed by sending the content of the text field to another activity.


<!--T:2-->
<!--T:2-->
The graphical user interface for an Android app is built using a hierarchy of <code>View</code> and <code>ViewGroup</code> objects. <code>View</code> objects are usually UI widgets such as buttons or text fields. <code>ViewGroup</code> objects are invisible view containers that define how the child views are laid out, such as in a grid or a vertical list.
The graphical user interface for an Android app is built using a hierarchy of View and ViewGroup objects. View objects are usually UI widgets such as buttons or text fields. ViewGroup objects are invisible view containers that define how the child views are laid out, such as in a grid or a vertical list.


<!--T:3-->
<!--T:3-->
Android provides an XML vocabulary that corresponds to the subclasses of <code>View</code> and <code>ViewGroup</code> so you can define your UI in XML using a hierarchy of UI elements.
Android provides an XML vocabulary that corresponds to the subclasses of View and ViewGroup so you can define your UI in XML using a hierarchy of UI elements.


<!--T:4-->
<!--T:4-->
<code>Layouts</code> are subclasses of the <code>ViewGroup</code>. In this exercise, you'll work with a <code>LinearLayout</code>.
Layouts are subclasses of the ViewGroup. In this exercise, you'll work with a LinearLayout.


== Create a Linear Layout == <!--T:5-->
== Create a Linear Layout == <!--T:5-->
Zeile 177: Zeile 176:


<!--T:33-->
<!--T:33-->
Here’s how your complete <code>activity_my.xml</code> layout file should now look:
Here’s how your complete activity_my.xmllayout file should now look:
</translate>
</translate>
''res/layout/activity_my.xml''
''res/layout/activity_my.xml''
Zeile 204: Zeile 203:


<!--T:35-->
<!--T:35-->
# In Android Studio, from the toolbar, click '''Run'''.
# In Android Studio, from the toolbar, click Run .
# Or from a command line, change directories to the root of your Android project and execute:</translate>
# Or from a command line, change directories to the root of your Android project and execute:
#: <code>ant debug</code>
#: <code>ant debug</code>
#: <code>adb install bin/MyFirstApp-debug.apk</code>
#: <code>adb install bin/MyFirstApp-debug.apk</code>
<translate>
 
<!--T:36-->
<!--T:36-->
Continue to the next lesson to learn how to respond to button presses, read content from the text field, start another activity, and more.
Continue to the next lesson to learn how to respond to button presses, read content from the text field, start another activity, and more.
</translate>
</translate>


{{TNT|Android Training/Attribution}}
{{Android Training/ Vorlage:Attribution}}
Bitte kopiere keine Webseiten, die nicht deine eigenen sind, benutze keine urheberrechtlich geschützten Werke ohne Erlaubnis des Urhebers!
Du gibst uns hiermit deine Zusage, dass du den Text selbst verfasst hast, dass der Text Allgemeingut (public domain) ist, oder dass der Urheber seine Zustimmung gegeben hat. Falls dieser Text bereits woanders veröffentlicht wurde, weise bitte auf der Diskussionsseite darauf hin. Bitte beachte, dass alle Android Wiki-Beiträge automatisch unter der „Creative Commons Attribution/Share-Alike Lizenz 3.0“ stehen. Falls du nicht möchtest, dass deine Arbeit hier von anderen verändert und verbreitet wird, dann klicke nicht auf „Seite speichern“.

Um das Wiki vor automatisiertem Bearbeitungsspam zu schützen, bitten wir dich, das folgende CAPTCHA zu lösen:

Abbrechen Bearbeitungshilfe (wird in einem neuen Fenster geöffnet)

Folgende Vorlagen werden auf dieser Seite verwendet: