只需要在onCreate中加入设置CacheColor就可以了
@Override protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState); mPrivacySettings = new PrivacySettings(this); addPreferencesFromResour
ce(R.xml.privacysettings);
this.getListView().setCacheColorHint(Color.parseColor("#00000000"));
this.getListView().setBackgroundColor(Color.rgb(76, 76, 76));
//。。。。
}
void android.widget.ListView.setCacheColorHint(int color)
public void setCacheColorHint (int color)
Since:
API Level 1
When set to a non-zero value, the cache color hint indicates that this list is always drawn on top of a solid, single-color, opaque background. Zero means that what's behind this object is translucent (non solid) or is not made of a single color. This hint will not affect any existing background drawable set on this view ( typically set via setBackgroundDrawable(Drawable)
).
Parameters
color | The background color |
---|