Android Question How to Remove NinePatch from a Button?

eelias

Active 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

Replies
4
Views
322
D
  • Question
Replies
11
Views
858
Deleted member 103
D
Top