0
我在做這樣的事情在佈局文件如何使用應用程序的命名空間的風格
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginTop="5dp"
android:textColorHint="@color/colorPrimary"
app:hintTextAppearance="@color/colorPrimary">
但我想用這種風格在多個地方,所以我試圖把它搬進style.xml文件
<style name="FindInstituteInputTextViewStyle" >
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">5dp</item>
<item name="android:layout_marginBottom">5dp</item>
<item name="android:textColorHint">@color/colorPrimary</item>
<item name="app:hintTextAppearence">colorPrimary</item>
</style>
但現在這給了我以下例外。
Error:(2376, 21) No resource found that matches the given name: attr 'app:hintTextAppearence'.
我也試圖把應用程序命名空間ATTR在<資源> 標籤內style.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
但同樣它沒有爲我工作。請幫助我,對不起,如果我正在做一些愚蠢的錯誤