0

以下のコードでは、nexus 電話でヒント テキストを表示できません。他の電話では問題なく動作し、コードに従って表示されます。

 <android.support.design.widget.TextInputLayout
                android:id="@+id/til"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout">
                <com.hul.humarashop.CustomFontTextView.EditTextGothamBook
                    android:id="@+id/editName"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:background="#00000000"                         
                    android:hint="Name"
                    android:padding="10dp"
                    android:singleLine="true"
                    android:textColor="#000000"
                    android:textColorHint="#000000"
                    android:textSize="15sp"></com.hul.humarashop.CustomFontTextView.EditTextGothamBook>

            </android.support.design.widget.TextInputLayout>
4

1 に答える 1

0

app:hint="Name"EditText ではなく、TextInputLayout に を設定します。

また、TextInputLayout にはgetEditText()メソッドがあることにも注意してください。これは、xml で 1 つの ID を使用するだけでよく、コードを少し整理する必要があることを意味します。

于 2015-10-26T09:44:54.197 に答える