我需要帮助在android slider.java
上添加背景,所以我想有一个背景并改变它:
getBackground ( R.drawable_slider_bg);
if leftslider = PRESSED (getBackground = (R.drawable.slider_left_bg));
if rightslider = PRESSED (getBackground = (R.drawable.slider_right_bg));
有人可以帮忙吗?
答案 0 :(得分:0)
// on slider.java
setBackgroundDrawable( R.drawable_slider_bg);
leftSlider.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
setBackgroundDrawable(R.drawable.slider_left_bg);
}
};
rightSlider.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
setBackgroundDrawable(R.drawable.slider_right_bg);
}
};