I wound up doing this in code --
((ImageButton) findViewById
(R.id.MyButton)).setOnFocusChangeListener(new OnFocusChangeListener()
{
public void onFocusChange(View view, boolean hasFocus) {
view.setBackgroundResource(hasFocus ?
R.drawable.focus_bg
sdphil wrote:
> I want to change the android:background value when an image button is
> selected (selected, not clicked). What's the easiest way to do that?
Step #1: Find the existing StateListDrawable resource for ImageButton
from the Android source code -- it should be an XML file
Step #2: Co
create *item-selector* xml and keep that xml in drawable folder and finally
use that as background of image button
On Fri, Sep 18, 2009 at 7:13 AM, sdphil wrote:
>
> I want to change the android:background value when an image button is
> selected (selected, not clicked). What's the easiest way
3 matches
Mail list logo