我收到警告,"此文本字段未指定inputType或提示"当我修改教程代码的副本时(如下所示)
<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" />
Run Code Online (Sandbox Code Playgroud)
这样可以正常工作,只有在创建新的空白行时才会出现警告
我已经为一个朋友修改了它,有几个注释行解释了它的每个部分但是,每当我在上面添加一个额外的行时(即使是空行,在这种情况下它是注释行)我收到上面的错误
<!--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 …Run Code Online (Sandbox Code Playgroud)