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

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

Nachricht im Original (Android Training/Building a Simple User Interface)
=== [http://developer.android.com/reference/android/view/View.html#attr_android:id <code>android:id</code>] ===
This provides a unique identifier for the view, which you can use to reference the object from your app code, such as to read and manipulate the object (you'll see this in the next lesson).
The at sign (<code>@</code>) is required when you're referring to any resource object from XML. It is followed by the resource type (<code>id</code> in this case), a slash, then the resource name (<code>edit_message</code>).
The plus sign (<code>+</code>) before the resource type is needed only when you're defining a resource ID for the first time. When you compile the app, the SDK tools use the ID name to create a new resource ID in your project's <code>gen/R.java</code> file that refers to the EditText element. With the resource ID declared once this way, other references to the ID do not need the plus sign. Using the plus sign is necessary only when specifying a new resource ID and not needed for concrete resources such as strings or layouts. See the sidebox for more information about resource objects.

android:id[Quelltext bearbeiten]

This provides a unique identifier for the view, which you can use to reference the object from your app code, such as to read and manipulate the object (you'll see this in the next lesson). The at sign (@) is required when you're referring to any resource object from XML. It is followed by the resource type (id in this case), a slash, then the resource name (edit_message). The plus sign (+) before the resource type is needed only when you're defining a resource ID for the first time. When you compile the app, the SDK tools use the ID name to create a new resource ID in your project's gen/R.java file that refers to the EditText element. With the resource ID declared once this way, other references to the ID do not need the plus sign. Using the plus sign is necessary only when specifying a new resource ID and not needed for concrete resources such as strings or layouts. See the sidebox for more information about resource objects.