Android Question How to Remove NinePatch from a Button?

EduardoElias

Well-Known Member
Licensed User
Longtime User
I couldnt find answer on the forum.

After applying ninepatch using the SetNinePatchButton I want to remove the png image from that button and return to the "normal"

How?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You cannot just remove it. You need to replace it with a different StateListDrawable. It will be simpler to remove the button and create a new one instead.
B4X:
Dim NewButton As Button
NewButton.Initialize("event name")
Dim parent As Panel = OldButton.Parent
parent.AddView(NewButton, OldButton.Left, OldButton.Top, OldButton.Width, OldButton.Height)
OldButton.RemoveView
 
Upvote 0

Similar Threads

Top