0
要儘可能短。TextInputLayout和AutoCompleteTextView背景在預覽中看起來很好,但在設備上始終是白色的
這是我的風格TextInputLayout
<style name="TextLabel" parent="Widget.AppCompat.AutoCompleteTextView">
<!-- Hint color and label color in FALSE state -->
<item name="android:textColorHint">@color/pure_white</item>
<!-- Label color in TRUE state and bar color FALSE and TRUE State -->
<item name="colorAccent">@color/pure_white</item>
<item name="colorControlNormal">@color/pure_white</item>
<item name="colorControlActivated">@color/pure_white</item>
<!-- When everything else failed I tried this but with no effect -->
<item name="android:background">@android:color/transparent</item>
</style>
而且這是在佈局
<android.support.design.widget.TextInputLayout
android:theme="@style/TextLabel"
android:layout_margin="@dimen/activity_margin_basic_double"
android:layout_centerInParent="true"
android:id="@+id/team_name_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<AutoCompleteTextView
android:id="@+id/new_team_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_team_create"
android:maxLines="1" />
</android.support.design.widget.TextInputLayout>
但是,這是我真正想要的和Android Studio預覽實際顯示它正確,它只是不會編譯這個方法:
任何想法如何得到這個排序嗎?我浪費了幾天的時間試圖找出這一個,但只是不能解決問題
非常感謝提前! Sloba
媽呀,太感謝你了,問題是,我在實際應用中具有'style'屬性的TextLabel樣式,但是我應該使用'android:theme'屬性來應用它。 –