Android Question FloatLabeledEditText - How to change background color and make borders visible

rgarnett1955

Active Member
Licensed User
Longtime User
Hi,

I am using the FloatLabeledEditText view and have set the Base Background to ColorDrawable = White (#FFFFFFFF) and the Border Color = Black (#FF000000), but when i run it the view is transparent with no border. Pl's see attached screen shot. I set the values in the designer and am using the views in a save dialog.

What I wish to do is:

  1. Make the background of the edit box white alpha = 1.0
  2. Make the border visible, width 2dpi and color dark gray
  3. Make the cursor black
  4. Make the cancel and save button text larger, bold and black

I need this as the phone is being used in the vegetable garden in sunlight and thus needs good contrast.

Best regards

Rob
 

Attachments

  • Screenshot_2020-07-08-09-48-53-00.png
    Screenshot_2020-07-08-09-48-53-00.png
    152.8 KB · Views: 294

Mahares

Expert
Licensed User
Longtime User
I need this as the phone is being used in the vegetable garden in sunlight and thus needs good contrast
Have you taken a look at B4XFloatTextField customview in XUI Views library. It is a much newer version of FloatLabel. You can set many of its properties via designer and programmatically. You can also expose the native edittext like this: For instance:
B4X:
Dim et As EditText = B4XFloatTextField1.TextField 'expose native view to give it a nice full border and rounded corner 
    Dim cd As ColorDrawable
    cd.initialize2(XUI.Color_ARGB(1,255,255,255),10dip, 5dip,XUI.Color_DarkGray)
    et.Background=cd
 
Upvote 0

rgarnett1955

Active Member
Licensed User
Longtime User
Hi,

Thank's for that.

Will give it a go.

Do you know if anyone posted a working example using this lib?

Best regards

Rob
 
Upvote 0

rgarnett1955

Active Member
Licensed User
Longtime User
Have you taken a look at B4XFloatTextField customview in XUI Views library. It is a much newer version of FloatLabel. You can set many of its properties via designer and programmatically. You can also expose the native edittext like this: For instance:
B4X:
Dim et As EditText = B4XFloatTextField1.TextField 'expose native view to give it a nice full border and rounded corner
    Dim cd As ColorDrawable
    cd.initialize2(XUI.Color_ARGB(1,255,255,255),10dip, 5dip,XUI.Color_DarkGray)
    et.Background=cd
Yes. Erel has. Search xui views

The Visible and Enabled Properties can be set in designed for these views, but these properties don't seem to be available in the code? Am I missing somethin?

Best regards

Rob
 
Upvote 0
Top