Android Question Is it possible to create buttons like this

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi, is it possible to create buttons like this (on the screen shot)?

Thanks
 

Attachments

  • Screenshot_20200205-154654.jpg
    123.1 KB · Views: 132

Alex_197

Well-Known Member
Licensed User
Longtime User
You can use CustomListView to create this.
Thanks for your replay.

But I mean how to create a button with an icon and a a text like on this screenshot. They don't have to be expandable.

The app this screenshot was taken from they are created by HTML (I think because without Internet this app doesn't even get started) but can it be done with b4a buttons?

Or do I need to create an image in a Photoshop and apply it as a bitmap?
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Thanks for your replay.
but can it be done with b4a buttons?

Or do I need to create an image in a Photoshop and apply it as a bitmap?

Buttons yes, advisable no as the images on the buttons will stretch and deform depending on different screen sizes.

You should use xCustomListView to create a layout like that...
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Thanks for your replay.

But I mean how to create a button with an icon and a a text like on this screenshot. They don't have to be expandable.
create a button and to that button, in seeting, add the text and the icon that you want (using FontAwesome and Material Icons)
like this:


Edit: Create a button -> Click Typeface FontAwesome -> Select the Icon and copy it in FontAwesome Icons and add the text.
 
Last edited:
Upvote 0

Mahares

Expert
Licensed User
Longtime User
In addition to what the other members are telling you , you can also use CSBuilder. I attached a very simple example that mixes text with image.

B4X:
Sub Globals
    Private Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("1")
    Dim cs As CSBuilder
    cs.Initialize.Size(30).Typeface(Typeface.SANS_SERIF)
    cs.Append("FOOTBALL:  ").Image(LoadBitmap(File.DirAssets, "brazil.png"), 60dip, 60dip, False).Append(CRLF)
    cs.PopAll
    Button1.Text = cs
End Sub
 

Attachments

  • CSBuilderExample.zip
    15.1 KB · Views: 143
  • brazil.png
    6.1 KB · Views: 178
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
@Mahares his screenshot looks full width and not exactly buttons. @f0raster0 I'm not sure that he is looking for a sliding menu, that was my fist thought too but looking at his screenshot I was not sure.

The main problem is that his screenshot isn't exactly informative because it's not a full screenshot but a cut out from a screenshot.

Nevertheless he now has not one, not two but three solution to choose from
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…