Page 1 of 1

How do I change the textcolor of the selected text in a native iOS field?

Posted: Tue Apr 13, 2021 12:24 pm
by williamdesmet
Hi there,

How do I get the selectedText of a native iOS field?
I want to change the color of the text selection in the field.

How do I adapt this code I made? (this obviously only returns the first char of the text in red)

Code: Select all

on changeColor
mobileControlDo "field1", "focus", true
put mobileControlGet ("field1", "text") into tText
put char 1 of tText into tColor 
mobileControlSet "field1" , "text", "" & tColor
mobileControlSet "field1", "textcolor", "255,0,0"
on changeColor
greetings,

William

Re: How do I change the textcolor of the selected text in a native iOS field?

Posted: Mon Apr 25, 2022 3:17 pm
by rcmills
I have this same problem. I would love to hear if anyone has been able to find a solution:)

Re: How do I change the textcolor of the selected text in a native iOS field?

Posted: Mon Apr 25, 2022 3:24 pm
by Klaus
If this:

Code: Select all

mobileControlSet "nameofnativefield", "textcolor", "255,0,0"
as shown in the dictionary, does not work, then I would consider this a bug!

Re: How do I change the textcolor of the selected text in a native iOS field?

Posted: Mon Apr 25, 2022 4:21 pm
by FourthWorld
Klaus wrote:
Mon Apr 25, 2022 3:24 pm
If this:

Code: Select all

mobileControlSet "nameofnativefield", "textcolor", "255,0,0"
as shown in the dictionary, does not work, then I would consider this a bug!
That sets the textColor for all text in the field. I am not aware of any text styling capabilities in LC for specific runs of text.

Re: How do I change the textcolor of the selected text in a native iOS field?

Posted: Mon Apr 25, 2022 4:44 pm
by Klaus
Oh, sorry, then I misunderstood the question.