demasi Active Member Licensed User Longtime User Feb 12, 2017 #1 Hello, Is there a way to set edittext base properties like corner radius, border color, border width by code? Maybe using reflector or something like? Thank you
Hello, Is there a way to set edittext base properties like corner radius, border color, border width by code? Maybe using reflector or something like? Thank you
M Mahares Expert Licensed User Longtime User Feb 12, 2017 #2 Did you see this?: You do not need reflector https://b4x.com/android/forum/threa...-radius-border-color-and-width-in-code.76016/ Upvote 0
Did you see this?: You do not need reflector https://b4x.com/android/forum/threa...-radius-border-color-and-width-in-code.76016/
demasi Active Member Licensed User Longtime User Feb 12, 2017 #3 Thank you Mahares. This is only part of the solution. I still need to set border color and width. I saw another post with a solution using java object to get the border witdth with jo.getfield("borderWidth"). I tried to change to setfield but somwthing was missing or wrong. Upvote 0
Thank you Mahares. This is only part of the solution. I still need to set border color and width. I saw another post with a solution using java object to get the border witdth with jo.getfield("borderWidth"). I tried to change to setfield but somwthing was missing or wrong.
M Mahares Expert Licensed User Longtime User Feb 12, 2017 #4 demasi said: I still need to set border color and width Click to expand... If you are looking for border and border color, the code referred to will do exactly that, without JavaObject or Reflector. Here is a more complete example with a picture of a button: Code: Copy Dim cd As ColorDrawable cd.Initialize2(Colors.Red,10dip,5dip,Colors.Cyan) btn.Background = cd btn.Text="I am a button" Attachments ButtonWithCornersAndBorder.png 23.5 KB · Views: 402 Upvote 0
demasi said: I still need to set border color and width Click to expand... If you are looking for border and border color, the code referred to will do exactly that, without JavaObject or Reflector. Here is a more complete example with a picture of a button: Code: Copy Dim cd As ColorDrawable cd.Initialize2(Colors.Red,10dip,5dip,Colors.Cyan) btn.Background = cd btn.Text="I am a button"
demasi Active Member Licensed User Longtime User Feb 12, 2017 #5 Great! Thank you again Mahares. It worked. I never looked at this Initialize2. A simple and working solution. Upvote 0
Great! Thank you again Mahares. It worked. I never looked at this Initialize2. A simple and working solution.