Page 1 of 1

Make a native iOS control text transparent

Posted: Thu Jun 27, 2013 3:00 pm
by Mag
Hi all,

I'm creating a native control to display credits in iOS. As bg of the stack I have black and there is a button with an image as icon below. On top of this there is a graphic I use to specify the rect of the native control. I done some tests but it seemst to me that I can have the native filed transparent in the way you see the button below. iOS seems to ignore this statement: mobileControlSet "myControl", "opaque", "false"

Any idea?

Code: Select all

      mobileControlCreate "multiline", "myControl" 
      mobileControlSet "myControl", "rect", the rect of graphic "creditsTextDisplay"
      mobileControlSet "myControl", "text", field "creditsTextFiled" of cd "localizations" of stack "SV-Resources"
      mobileControlSet "myControl", "visible", "true"
      mobileControlSet "myControl", "editable", "false"
      
      mobileControlSet "myControl", "textColor", "200,200,200"
      mobileControlSet "myControl", "dataDetectorTypes", "link"
      mobileControlSet "myControl", "textAlign", "center"
      
      mobileControlSet "myControl", "autoCorrectionType", "false"
      mobileControlSet "myControl", "scrollingEnabled", "true"
      
      mobileControlSet "myControl", "opaque", "false"

      if the platform is "iphone" then -- iOS
         mobileControlSet "myControl", "borderStyle", "none"
         mobileControlSet "myControl", "fontSize", "16"
      else if the platform is "android" then -- ANDROID
         mobileControlSet "myControl", "multiline", "true"
         mobileControlSet "myControl", "fontSize", "5"
      end if

Re: Make a native iOS control text transparent

Posted: Thu Jun 27, 2013 4:41 pm
by Dixie
There is no 'opaque' property available for iOSNative fields...

Re: Make a native iOS control text transparent

Posted: Thu Jun 27, 2013 5:26 pm
by Mag
Thank you Dixie.

Re: Make a native iOS control text transparent

Posted: Thu Jun 27, 2013 7:58 pm
by gpb01
From the iOS release notes :
All controls (UIView):
...
backgroundColor read/write Set to either a standard color name, or a string of the form red,green,blue or red,green,blue,alpha. Where the components are integers in the range 0 to 255.
...

So, try to set the background color using the alpha channel ...

Code: Select all

mobileControlSet "myControl", "backgroundColor", "R_value,G_value,B_value,Alpha_Value"
... probably works ;)

Guglielmo

Re: Make a native iOS control text transparent

Posted: Thu Jun 27, 2013 8:20 pm
by Mag
Works great. Thank you!

Re: Make a native iOS control text transparent

Posted: Thu Jun 27, 2013 9:29 pm
by Dixie
Guglielmo...

I stand corrected and have learnt something today... I completely missed that in the release notes.. nice one !

Dixie

Re: Make a native iOS control text transparent

Posted: Fri Jun 28, 2013 2:17 pm
by gpb01
Dixie wrote: ... I completely missed that in the release notes ...
... it happens to me many many times :D :D :D

Guglielmo