カスタム属性スタイルを次のように作成しました
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="EffectsTextView">
<attr name="strokeWidth" format="float" />
<attr name="strokeMiter" format="float" />
<attr name="strokeColor" format="color" />
</declare-styleable>
</resources>
レイアウト ファイルでは、このカスタム属性を使用して、この属性に名前空間を割り当てることができます。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:effects="http://schemas.android.com/apk/res-auto/com.base.view.EffectsTextView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#40000000" >
<com.base.view.EffectsTextView
android:id="@+id/textView1"
android:layout_width="290dip"
android:layout_height="80dip"
android:layout_marginLeft="5dip"
android:layout_marginTop="16dip"
android:gravity="center"
android:text="SETTINGS"
android:textSize="44dip"
android:textStyle="bold"
effects:strokeWidth="10" /> <--- custom tag "effects"
ただし、styles.xml でこのカスタム タグを認識していませんでした。
<style name="EffectsHeaderTextStyle">
<item name="effects:strokeWidth">10</item>
</style>
エラー: RelativeLayout ファイルで行ったのと同じ名前空間を配置しましたが、指定された名前の効果に一致するリソースが見つかりませんでした。
何か案は?ありがとう