我使用的是 preferenceFragment
(不带的ListView
),但我无法设置背景色,它似乎是透明的。
I am using a PreferenceFragment
(without a ListView
), but am unable to set the background color, and it seems to be transparent.
我如何设置背景颜色为白色与 preferenceFragment
?
How can I set the background color to white with PreferenceFragment
?
编辑: 第一张截图:
first screenshot:
重写onCreateView无法正常工作 -
Overriding onCreateView not work -
这个问题也回答了here
添加以下code到你的preferenceFragment将让你添加一个背景颜色,图像等。
Adding the following code to your PreferenceFragment will let you add a background color, image, etc.
@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;
}
上一篇:在BouncyCastle的RSA PKCS1-OAEP冗余支持?冗余、RSA、BouncyCastle、OAEP
下一篇:带有 CCLayer for iOS 6 的 Cocos2d 横向 Gamecenter 身份验证横向、身份验证、for、CCLayer