soxueren / whirlyglobe

Automatically exported from code.google.com/p/whirlyglobe
0 stars 0 forks source link

changing the background of WhirlyGlobe #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I need to change the background of whirlyGlobe to a custom image. can you guide 
me as to how it is to be done?

Original issue reported on code.google.com by vriti.si...@gmail.com on 16 Aug 2012 at 4:16

GoogleCodeExporter commented 8 years ago
I imagine you could set the background color to clearColor and just overlay the 
view on a UIImageView.

Incidentally,  I've moved WhirlyGlobe over to github.

Original comment by s...@mousebirdconsulting.com on 25 Aug 2012 at 11:45

GoogleCodeExporter commented 8 years ago
Any luck getting this to work?  I tried doing exactly that (use a clearColor 
background and put an image view behind it), and it doesn't seem to work.

Original comment by dbl...@double-apps.com on 3 Nov 2012 at 5:02

GoogleCodeExporter commented 8 years ago
BTW, I'm using the WhirlyGlobeComponent, trying to set the 'clearColor' 
property of the WhirlyGlobeViewController class to [UIColor clearColor].  Also 
tried to set the backgroundColor of the controller's view.  Either way, I 
always get a black background.  If I set it to some other color, the background 
will be that color.

Original comment by dbl...@double-apps.com on 3 Nov 2012 at 5:21

GoogleCodeExporter commented 8 years ago
Got it to work ... in case anybody else runs into this, in viewDidLoad in 
TestViewController.m, there is this code:

    // Set the background color for the globe
    globeViewC.clearColor = [UIColor blackColor];

Change it to this:

    // Set the background color for the globe
    globeViewC.clearColor = [UIColor clearColor];
    globeViewC.view.backgroundColor = [UIColor clearColor];
    UIView* sv = [globeViewC.view.subviews objectAtIndex:0];
    sv.backgroundColor = [UIColor clearColor];

Then put whatever views you need behind globeViewC.view

Original comment by dbl...@double-apps.com on 3 Nov 2012 at 6:07