android的selector选择器
1. drawable/actionbar_compat_item.xml

2.drawable/actionbar_compat_item_pressed.xml

3.drawable/actionbar_compat_item_focused.xml

4.
public StateListDrawable setbg(Integer[] mImageIds) { StateListDrawable bg = new StateListDrawable(); Drawable normal = this.getResources().getDrawable(mImageIds[0]); Drawable pressed = this.getResources().getDrawable(mImageIds[1]); Drawable focused = this.getResources().getDrawable(mImageIds[2]);
bg.addState(View.EMPTY_STATE_SET, normal);
bg.addState(view.PRESSED_ENABLED_STATE_SET,pressed);
bg.addState(View.FOCUSED_STATE_SET, focused);
return bg; }
                    
                
                
            
        
浙公网安备 33010602011771号