EduardoElias Well-Known Member Licensed User Longtime User Dec 4, 2017 #1 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?
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 Dec 4, 2017 #2 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. Code: Copy 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
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. Code: Copy 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