otrzymuję ostrzeżenie: „To pole tekstowe nie określa InputType lub podpowiedź” Kiedy modyfikowania kopię kodu samouczka (poniżej)To pole tekstowe nie określa InputType lub podpowiedź
<EditText android:id="@+id/edit_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/edit_message"
android:layout_weight="1" />
To działa dobrze, a ostrzeżenie pojawia się tylko wtedy, gdy zostanie utworzona nowa pusta linia.
Zmodyfikowałem ją dla znajomego z kilkoma liniami komentarza wyjaśniającymi, co robi każda jego część, za każdym razem, gdy dodam dodatkową linię w powyższym (Nawet pusta linia, w tym przypadku jest to linia komentarza) Otrzymuję powyższy błąd
<!--edit text creates a text input box-->
<EditText android:id="@+id/edit_message"
<!-- edit_message is a variable, defined in strings.xml-->
<!-- determines the width of the textField, in this case 0dp means "however long the text is" IE: it will grow to fit however many characters the user types -->
android:layout_width="0dp"
<!-- determines the height of the Text Field -->
android:layout_height="wrap_content"
<!-- The hint is the default value for the text field, it calls on the variable edit_message defined in strings.xml-->
android:hint="@string/edit_message"
<!-- Weight means how much the screen the text field can take up, in this case, the ratio is 1:1 so it can take up however much room is needed, However if a different variable also had the weight of 1, the ratio would be 1:2 and each could take up half the screen -->
android:layout_weight="1" />
Bez uwag, ostrzeżenie nie ma
O ile mi wiadomo, nie można pozwolić, aby komentarze przerwały element xml. To znaczy. nie możesz wstawiać komentarzy pomiędzy ' '. [Podobne pytanie] (http://stackoverflow.com/a/16904880/1029225), z kojarzeniem z tym samym fragmentem kodu, zostało niedawno odebrane. –