Re: transparent “multiline” UITextField
Devin Asay
devin_asay at byu.edu
Thu Apr 3 11:13:08 EDT 2014
On Apr 3, 2014, at 12:33 AM, Scott Morrow <scott at elementarysoftware.com>
wrote:
> I’m trying to make a transparent “multiline” UITextField in iOS. Unfortunately, it remains opaque both in the simulator and on an actual device. If I switch the style of the UITextField to “input” then it becomes transparent. I’m doing something along the lines of:
>
> mobileControlCreate "multiline", pFieldName
> mobileControlSet pFieldName, "rect", tRect
> mobileControlSet pFieldName, "opaque", "false"
> mobileControlSet pFieldName, "visible", “true"
>
> I’m suspicious that it may be operator error since I can’t get it working under the last several previous LC versions and I didn’t notice a bug report. Suggestions?
> (tested with LC 6.1.3, 6.5.2, 6.6, 6.7dp1 and 6.6.1rc1 Commercial)
Scott,
I had puzzled over this before, too. It turns out, a little confusingly, that you have to set the alpha channel on the backgroundColor rather than the opaque property:
mobileControlSet pFieldName, "backgroundColor", "255,255,255,0"
mobileControlSet pFieldName, "opaque", false
I tried it with the opaque property set to both true and false; it didn't seem to make any difference. In fact, it worked fine without setting the opaque property.
The old iOS release notes (and the current dictionary entry for mobileControlSet) give a confusing description of the opaque property of mobile native controls:
"Set to false if the control should be rendered with transparency. In particular, set this control to true if you set a backgroundColor that is not fully opaque."
Months ago I had printed out the release notes for closer study. Next to that paragraph I penciled in the comment "?". Indeed.
Can anyone explain what that means?
Regards,
Devin
Devin Asay
Office of Digital Humanities
Brigham Young University
More information about the use-livecode
mailing list