当我修改教程代码的副本时,我收到警告“此文本字段未指定 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" />
这工作正常,只有在创建新的空白行时才会出现警告
我已经为朋友修改了几行注释,解释了它的每个部分的作用,但是,每当我在上面添加额外的行(即使是空行,在这种情况下它是注释行)时,我都会收到上述错误
<!--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" />
没有评论,警告不存在