StateListDrawable があるとします。その中に2つのドローアブルを追加したいと思います.1つ目はクリックされた場合、2つ目は他の状態の場合です。
次のように試しました(疑似コード):
Drawable clickdDrawable = getResourses.getDrawable(R.drawable.presseddrawable);
clickDrawable.setBounds(-100, -100, 100, 100);
Drawable otherStateDrawable = getResources().getDrawable(R.drawable.somedrawable);
otherStateDrawable.setBounds(-50,-50, 50, 50);
StateListDrawable sld = new StateListDrawable();
sld.addState(new int[]{andriod.R.attr.state_pressed, android.R.attr.state_focussed}, clickDrawable);
sld.addState(StateSet.WILDCARD, otherStateDrawable);
sld.setBounds(-50, -50, 50, 50);
今、私が押された状態にある場合、presseddrawable を取得しますが、それは StateListDrawable の境界に固執します。だから私の質問は: StateListDrawable 内に異なる境界を持つ Drawables を格納する方法は? これは可能ですか?