Android Question button

Almora

Well-Known Member
Licensed User
Longtime User
hellohow can I create such a button.
 

Attachments

  • Picsart_25-04-06_21-44-20-507.jpg
    Picsart_25-04-06_21-44-20-507.jpg
    29.2 KB · Views: 42

BlueVision

Well-Known Member
Licensed User
Longtime User
Several options...
The easiest way is to use an ImageView or B4XImageView for it. Then evaluate the ClickEvent of the ImageView as ButtonClickEvent.
If you need an animation, you can also use an animated GIF file.
Of course, this option has certain limitations compared to a regular button when it comes to the ‘pressed’ state, etc. You will have to program these things separately.
Of course, you can also use a regular button to which you can then assign separate layouts using the Designer.
 
Last edited:
Upvote 0

Almora

Well-Known Member
Licensed User
Longtime User
i thought of it as button on button, and the edges are like in the picture..
 

Attachments

  • Screenshot_20250406_230327.jpg
    Screenshot_20250406_230327.jpg
    49.7 KB · Views: 23
Upvote 0

BlueVision

Well-Known Member
Licensed User
Longtime User
I'm not quite sure how you imagine it exactly. It actually depends on what should happen graphically from the user's point of view when the button is pressed.
In this case, I would place a coloured label under the button. This label is masked by the layout of the button's graphic. Use a transparent GIF file with a hole for the button. Then it is easy to make the button ‘react’ by colouring the label under the button differently or making it disappear. Under the label there could be something else that then becomes visible when the label disappears into the cutout of the button graphic. It's a bit complicated, but it all comes down to the Z-order.
 
Upvote 0

BlueVision

Well-Known Member
Licensed User
Longtime User
This is an example of a PlusMinusButton that I've built from several labels for an xCustomListView. Maybe it goes in the direction you're thinking. But it could also be that we're talking at cross purposes...
1.jpg
 
Upvote 0
Top