Android Question How to add solid outline color for text?

Widget

Well-Known Member
Licensed User
Longtime User

This is an improvement. (See image)

B4X:
Sub Activity_Create(FirstTime As Boolean)'Do not forget to load the layout file created with the visual designer. For example:'Activity.LoadLayout("Layout1")Activity.Color = Colors.Black
 Label1.Initialize("")
 Label1.Text = "Testing"
 Label1.TextSize = 100
 Label1.TextColor = Colors.BlueActivity.AddView(Label1, 20Dip, 20Dip, 500dip, 500dip)
 Private jo AsJavaObject = Label1' Private Radius = 4dip, dx=0dip, dy=0dip As FloatPrivate Radius = 10dip, dx=0dip, dy=0dipAs Float
 jo.RunMethod("setShadowLayer", Array(Radius, dx,dy, Colors.Yellow))End Sub

But there are 2 problems.
  1. Doesn't "setShadowLayer" require hardware acceleration to be turned on? And it is turned on for targetSDK >= 14 but not for Android 6?
  2. The shadow it produces uses a blur, which is fine on large text but is barely noticeable on smaller text. Is there a way to eliminate the blur so it works better on smaller text?
TIA
 

Attachments

  • TextShadow.png
    19.9 KB · Views: 333

Erel

B4X founder
Staff 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…