Translations:Android Training/Building a Simple User Interface/23/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/23/en nach Translations:Android Training/Building a Simple User Interface/23/en, ohne dabei eine Weiterleitung anzulegen: Teil der übersetzba…)
 
(kein Unterschied)

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

Nachricht im Original (Android Training/Building a Simple User Interface)
== Add a Button ==
# In Android Studio, from the <code>res/layout</code> directory, edit the <code>activity_my.xml</code> file.
# Within the <code><LinearLayout></code> element, define a [http://developer.android.com/reference/android/widget/Button.html <code><Button></code>] element immediately following the <code><EditText></code> element.
# Set the button's width and height attributes to <code>"wrap_content"</code> so the button is only as big as necessary to fit the button's text label.
# Define the button's text label with the [http://developer.android.com/reference/android/widget/TextView.html#attr_android:text <code>android:text</code>] attribute; set its value to the <code>button_send</code> string resource you defined in the previous section.
Your <code><LinearLayout></code> should look like this:

Add a Button[Quelltext bearbeiten]

  1. In Android Studio, from the res/layout directory, edit the activity_my.xml file.
  2. Within the <LinearLayout> element, define a <Button> element immediately following the <EditText> element.
  3. Set the button's width and height attributes to "wrap_content" so the button is only as big as necessary to fit the button's text label.
  4. Define the button's text label with the android:text attribute; set its value to the button_send string resource you defined in the previous section.

Your <LinearLayout> should look like this: