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
'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:
B4X:
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
Sub imgpanel_Touch (Action As Int, X As Float, Y As Float)
Select Action
Case Activity.ACTION_DOWN
'this part is equivalent to _click event
End Select
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.