views:

378

answers:

2

Hi, I'm working on an iPhone game written in Objective C (which I'm new to). The problem is that the views which are used to draw the sprites on screen are semi transparent. I have set the alpha to 1.0 and the opacity to True. I have also used NSLog to confirm that the views' alphas are 1.0. I was using [self.view insertSubview:myView]; to add a view to be drawn but also tried [self.view insertSubview:myView aboveSubview:myOtherView]; just in case they were drawing onto each other.

I have tried searching google but can't seem to articulate a query which helps. I'm using OS 3.0. and I haven't included all the code because there is a lot of it. ANY help would be much appreciated.

A: 

I'm not sure why you are getting semi-transparent views, but I would suggest not using UIViews for an iPhone game. Try a more game-oriented system like cocos2d. http://www.cocos2d-iphone.org/

Jonathan Sterling
+1  A: 

Is the view to which you are referring a subview to another view that has an alpha set to a value less than 1.0? Alphas propagate down the the view hierarchy.

Amagrammer
That was it, When the revolution comes Austrailia shall be yours.
Keith Loughnane
I hereby vow that Australia will prosper under my benevolent reign!Back to the original topic -- I just did a quick experiment -- the alpha continues to propagate through the view hierarchy *even* if you set the inner view's opaque = YES. Sad. Would be nice to be able to "restart" the alpha. Probably very hard for Apple to implement though.
Amagrammer