iOS Question GetButtonTextColor ? [Resolved]

stingrae

Member
Licensed User
Hi,

I'm using the function below to set the Text Colour of a button. But I can't seem to figure out how to re-engineer it to Get the text button's colour.

(basically I want to set Button1's TextColor property to be the same as Button2)

Can someone help me out please? :)

B4X:
Sub SetButtonTextColor(btn As Button, clr As Int, state As Int)
    ' state: 0 = normal, 1 = pressed, 2 = disabled
    Dim no As NativeObject = btn
    no.RunMethod("setTitleColor:forState:", Array(no.ColorToUIColor(clr), state))
End Sub
 
Top