Code example for ImageButton

Methods: setBackgroundDrawable

0
        slider.getLayoutParams().height = barHeight;
    } 
 
    public void setBarBackground(Drawable background) {
        if(android.os.Build.VERSION.SDK_INT < 16) {
            slider.setBackgroundDrawable(background);
        } 
        else { 
            slider.setBackground(background);
        } 
    } 
 
    public void setBarBackgroundResource(int background) {
        slider.setBackgroundResource(background);
    } 
 
    public void setBodyBackground(Drawable background) {
        if(android.os.Build.VERSION.SDK_INT < 16) {
            body.setBackgroundDrawable(background);
        } 
        else {