Android Question Button Properties

Duque

Active Member
Licensed User
Longtime User
Friends I need help, I created a panel which I add a few buttons per code but I can not find the properties for:
* Put an image on the button
* Know if pressed or not
* Round the top corners only
 
Thanks, it worked perfectly, it is possible to round off only the top corners, not all corners

example:

Corner radius (0,0,5,5)
 
Upvote 0
'I have solved the click to the button and change the image with this function, as for rounding, you propose to create panels and use them as buttons?
code:
Code: Copy
Sub estiloB2(b As Button)
'al clic
    Dim img1 As BitmapDrawable
     img1.Initialize(LoadBitmap(File.DirAssets,"ant.ico"))
'al soltar
    Dim img2 As BitmapDrawable
     img2.Initialize(LoadBitmap(File.DirAssets,"carg.ico"))

    Dim cambio As StateListDrawable
    cambio.Initialize
'al click
    Dim states(2) As Int
    states(0) = cambio.state_enabled
    states(1) = -cambio.state_pressed
    cambio.addState2(states, img1)
'al soltar
    Dim states(1) As Int
    states(0) = cambio.state_pressed
    cambio.addState2(states, img2)
    b.Background = cambio
End Sub
 
Last edited:
Upvote 0
CODETAGS.png
 
Upvote 0
Back
Top