I have set a theme for my application, which includes a blue background...
However, this made my preference fragment blue too. I want to keep the original "android:Theme.Holo.Light.DarkActionBar".
How to do so? thanks!
I have set a theme for my application, which includes a blue background...
However, this made my preference fragment blue too. I want to keep the original "android:Theme.Holo.Light.DarkActionBar".
How to do so? thanks!
将以下代码添加到您的 PreferenceFragment 实现中:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
view.setBackgroundColor(getResources().getColor(android.R.color.your_color));
return view;
}
您可以使用样式文件或在您的 PreferenceActivity 添加此
getListView().setBackgroundColor(Color.rgb(255, 0, 0)); // or whatever color value you want