textColor 属性が機能していません。ここに私のXMLがあります:
<PreferenceCategory
        android:title="Title"
        android:textColor="#00FF00">
何か案は?
textColor 属性が機能していません。ここに私のXMLがあります:
<PreferenceCategory
        android:title="Title"
        android:textColor="#00FF00">
何か案は?
このカスタマイズ PreferenceCategory クラスを使用します。
public class MyPreferenceCategory extends PreferenceCategory {
    public MyPreferenceCategory(Context context) {
        super(context);
    }
    public MyPreferenceCategory(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
    public MyPreferenceCategory(Context context, AttributeSet attrs,
            int defStyle) {
        super(context, attrs, defStyle);
    }
    @Override
    protected void onBindView(View view) {
        super.onBindView(view);
        TextView titleView = (TextView) view.findViewById(android.R.id.title);
        titleView.setTextColor(Color.RED);
    }
}
これを Pref.xml ファイルに追加します。
<ali.UI.Customize.MyPreferenceCategory android:title="@string/pref_server" />
    1 つの解決策は、PreferenceScreen のテーマを作成することです。したがって、themes.xmlまたはstyles.xmlで(themes.xmlに配置することをお勧めします):
<style name="PreferenceScreen" parent="YourApplicationThemeOrNone">
    <item name="android:textColor">@color/yourCategoryTitleColor</item>
</style>
次に、 AndroidManifest.xml で:
<activity
      android:name="MyPreferenceActivity"
      ...
      android:theme="@style/PreferenceScreen" >
</activity>
それは私にとって完璧に機能しました。
実際、 を使用して設定カテゴリのテキストを見つけたところcolorAccentです。
アプリで のスタイルを使用していない場合はcolorAccent、 に移動してstyles.xmlを見つけ<item name="colorAccent">@color/colorPrimary</item>、必要に応じて色を変更できます。
public class MyPreferenceCategory extends PreferenceCategory {
 public MyPreferenceCategory(Context context) {
    super(context);
    // TODO Auto-generated constructor stub
  }
 public MyPreferenceCategory(Context context, AttributeSet attrs) {
    super(context, attrs);
  }
 public MyPreferenceCategory(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);
    // TODO Auto-generated constructor stub
  }
 @Override
 protected View onCreateView(ViewGroup parent) {
    // It's just a TextView!
 TextView categoryTitle =  (TextView)super.onCreateView(parent);
 categoryTitle.setTextColor(parent.getResources().getColor(R.color.orange));
    return categoryTitle;
  }
}
そしてあなたのprefs.xmlで:
<com.your.packagename.MyPreferenceCategory android:title="General">
.
.
.
</com.your.packagename.MyPreferenceCategory>
または、この回答を使用することもできます