我正在使用设计库中的新TextInputLayout。我成功地让它显示并更改了浮动标签的颜色。不幸的是,它没有将文本转换为大写字母。
我不想更改strings.xml文件,因为我只想让这个标签变成大写字母形式。我已尝试在布局、样式和程序上更改textAllCaps,但EditText提示的大小写总是与strings.xml相同。
以下是我的TextInputLayout和EditText的XML代码:
我不想更改strings.xml文件,因为我只想让这个标签变成大写字母形式。我已尝试在布局、样式和程序上更改textAllCaps,但EditText提示的大小写总是与strings.xml相同。
以下是我的TextInputLayout和EditText的XML代码:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android.support.design:hintTextAppearance="@style/TextInputLayout">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/city"
android:textColorHint="@color/black"
android:hint="@string/city" />
</android.support.design.widget.TextInputLayout>
以下是我使用的TextInputLayout样式(我尝试使用仅有的"textAllCaps"属性(而不带"android:")但对我没有任何效果):
<style name="TextInputLayout" parent="@android:style/TextAppearance">
<item name="android:textAllCaps">true</item>
</style>