help - change text align at runtime

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi

i am trying to change text align from right to left or left to right at runtime
i try something like this but it does not work - no change
perhaps gravity is not the right way ?
anyone can help
thanks

For i = 0 To Activity.NumberOfViews - 1

G = Gravity.RIGHT

If Activity.GetView(i) Is Label Then
L = Activity.GetView(i)
L.Gravity = G
End If

If Activity.GetView(i) Is CheckBox Then
C = Activity.GetView(i)
C.Gravity = G
End If

If Activity.GetView(i) Is EditText Then
E = Activity.GetView(i)
E.Gravity = G
End If

If Activity.GetView(i) Is RadioButton Then
R = Activity.GetView(i)
R.Gravity = G
End If

Next
 

klaus

Expert
Licensed User
Longtime User
The code I sent you DOES work !

Sorry, it's not enough just saying it doesn't work. You must send the code you are using to be able to help you otherwise we must try to guess what error you could have made.

You asked to change the background color, the code I sent you does it.

You get the compiler error because it seems that you are trying to read a background color and this is unfortunately not possible the Color property is write only. To get the color it's not that easy, have a look at this tread.

Best regards.
 
Upvote 0
Top