Shadows on the text of a widget

bgsoft

Well-Known Member
Licensed User
Longtime User
Hello

Can anyone tell me how to put shadows a text of a label of a widget?

thanks

Jesus
 

bgsoft

Well-Known Member
Licensed User
Longtime User
Thank you for your quick response

But, how can I pass to this sub the object "label" of a widget?

Jesus
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
I was hoping there was another solution that was not put two labels . So I asked the question.

Thanks for your answer

Jesus
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
You have to modify the generated layout xml file in the Objects/res/layouts folder and add the following properties to the TextView (change the values to your needs):
android:shadowColor="#88000000" android:shadowDx="0" android:shadowDy="0" android:shadowRadius="4.0"

Then make the xml read only (and I think you have to make the background drawable xml in Objects/res/drawable read only, too because it gets deleted but not created again when the layout file is read only).
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
Viel Dank

It worked! :wav:

I also had to make read-only pictures, since it an error occurred when compiling.

Now I'm "playing" with height and width parameters. Before by code only if 80dp exceeded the widget was 2 cells, now 90 and still exceed 1 cell.

When I finish testing, I will expose the conclusions, as there is little documentation on the forum widget measures

Thanks again

regards

Jesus
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
Good morning:

I've been doing tests measures to get the values ​​I needed. ever put width and height values ​​of 110 in the properties panel:

B4X:
android: layout_width = "110dp"
android: layout_height = "110dp"

These values ​​when edited from Abstract Designer, I did more than one cell. On a mobile of resolution 1080 x 1920, when he passed 80, creating two cells.

These tests were you doing on the phone with 1080 x 1920 resolution, to copy the widget to another phone with 480x800 resolution, the text was cut off.

Adding to the panel, the property:

B4X:
android: ResizeMode = "vertical"

In this way the mobile of 480x800, you see the full widget, but takes more cells.

I think it would be interesting to find a way to make a call to these properties from code and not have to edit the xml file. Something similar to a library RunMethod the reflector, as proposed thedesolatesoul.


regards

Jesus
 
Upvote 0
Top