[MonoTouch] Background color of a UIWebView
Jason Awbrey
jason at awbrey.net
Sat Oct 22 08:04:07 EDT 2011
UIWebView has an Opaque property that you need to set to false in order for
the background to show.
On Sat, Oct 22, 2011 at 4:17 AM, Guido Van Hoecke <guivho at gmail.com> wrote:
> I have two xibs where I add a UIWebView in code. The html is also built
> in code and sets a specific background color, say maroon.
>
> This works as expected on the simulator, but on the iPhone there's
> always a short but disturbing period during which a plain white view is
> shown which is then replaced by my html with the maroon background.
>
> I've tried creating the view in either 'ViewWillAppear' or in
> 'ViewDidLoad' but the problem occurs in both cases.
>
> I've tried to avoid the white background by creating the UIWevView with
> e.g. a hard-coded black background as in
>
> var webView = new UIWebView() { Frame = frame, BackgroundColor =
> UIColor.Black };
>
> but the black never shows, and it still gives the white flash background
> on the iPhone, and not on the simulator.
>
> I realize that this has all the characteristics of a possible timing
> (processing power) problem where the simulator on the mac is obviously
> more powerful than the iPhone. Tho only activity that may be a bit time
> consuming is the generation of the html string so I tried it with a hard
> coded string which has only a maroon colored empty body. Same problem
> though.
>
> This is so frustrating as it really looks very sloppy on the device.
>
> Please advise, and TIA,
>
>
> Guido
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111022/253fd7c7/attachment.html
More information about the MonoTouch
mailing list