大家好,我需要一个帮助托盘在 androidslider.java 上添加背景,所以我想要一个背景并像这样更改它:
getBackground ( R.drawable_slider_bg);
if leftslider = PRESSED (getBackground = (R.drawable.slider_left_bg));
if rightslider = PRESSED (getBackground = (R.drawable.slider_right_bg));
有人可以帮忙吗?
编辑:这个怎么样,有什么建议吗?
public void setBackgroundDrawable (int) {
setBackgroundDrawable(R.drawable.slider_bg);
if (LeftSlider == STATE_PRESSED) {
setBackgroundDrawable(R.drawable_slider_bg_left);
}
if (RightSlider == STATE_PRESSED) {
setBackgroundDrawable(R.drawable_slider_bg_right);
}
};
干杯