Android Question Button Disabled Background

Stefano Di Chiano

Active Member
Licensed User
Hi,
in the designer I set for my buttons the "Drawable" property on "Statelist Drawable" and I set two different images for the "Enabled Drawable" and the "Disabled Drawable" properties. When I set button.Enabled = False in one of the click events though, the background image of the button doesn't change.
What am I missing? Doesn't it work that way?
 

Stefano Di Chiano

Active Member
Licensed User
It's hard to post them cause once I click on a button it never stops showing more things in the logs, but now that I tried again your project seems to work in debug mode as well.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I had a look at your project.
I suppose that the problem is with btnFacebook.
I see that you have no bitmap file for Enabled Drawable, why!?
But you have facebookdisabled.png for Pressed Drawable !?
Is this really what you want !?

1600457899874.png
 
Upvote 0

Stefano Di Chiano

Active Member
Licensed User
Yes, it was a mistake, now it works, but here's the thing: this was a dummy project I made to recreate the original project's issue. I can't upload the original project cause I'm now encountering another error (https://www.b4x.com/android/forum/threads/no-resourse-found.122524/). As soon as I solve that, I'll upload the original project.

EDIT: solved. I made a new project from scratch and it seems to work now. Thanks for all the help.
 
Last edited:
Upvote 0
Top