Android Question Edittextbox Background Color

Devendra

Member
Licensed User
Longtime User
Dear Erel,


I have a issue in changing the background color of the edit text box control also if you can put a image that would be lovely please let me know the answer
 

James Chamblin

Active Member
Licensed User
Longtime User
What kind of issue are you having? This works for me.

Activity.LoadLayout("main")
EditText1.Color = Colors.Magenta

As for assigning an image to the edit text, you can do that in code
B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Private EditText1 As EditText
   Dim drw As BitmapDrawable
   Dim bmp As Bitmap
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("main")
   bmp.Initialize(File.DirAssets,"smiley.gif")
   drw.Initialize(bmp)
   EditText1.Background = drw

End Sub
 
Upvote 0

Devendra

Member
Licensed User
Longtime User
What kind of issue are you having? This works for me.

Activity.LoadLayout("main")
EditText1.Color = Colors.Magenta

As for assigning an image to the edit text, you can do that in code
B4X:
Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Private EditText1 As EditText
   Dim drw As BitmapDrawable
   Dim bmp As Bitmap
End Sub

Sub Activity_Create(FirstTime As Boolean)
   'Do not forget to load the layout file created with the visual designer. For example:
   Activity.LoadLayout("main")
   bmp.Initialize(File.DirAssets,"smiley.gif")
   drw.Initialize(bmp)
   EditText1.Background = drw

End Sub

No i was referring the Designer , I think Designer should be improved a lot, The Eclips
has lots of more controls than the B4A designer
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The Eclips
has lots of more controls than the B4A designer

Feel free to use Eclipse to develop android-apps (and wasting much much more time to do so) :D

But if you have concrete wishes for B4A you can create a thread in the wish-list-forum ;)
 
Upvote 0
Top