tags:

views:

247

answers:

4

Hi

I have a UINavigationController containing an UIViewController initialized with a UIView.

The UINavigationController also has a UINavigationBar as usual.

Previously when I positioned a new element in the UIView at 0,0 using

CGRectMake(0,0,height,width);

It would position it directly beneath the UINavigationController. However since compiling with 2.2 it now positions 0,0 directly behind the UINavigationBar (where you would expect 0,0 to be normally).

This only happens when the application is recompiled with the 2.2 SDK - the application left on the iPhone from before the upgrade still works as expected.

Thing is, I quite want my application to draw correctly with 2.2 as well as be backwards compatible with 2.1

Has anyone seen this behaviour, or know anything more about this?

Thanks!

+1  A: 

There is a whole (very useful) thread on things that 2.2 broke over on the Apple dev forums. It includes this issue (though without any fix). I've seen it mentioned elsewhere as well.

It's worth checking it out

https://devforums.apple.com/message/12297#12297 (link fixed)

Airsource Ltd
A: 

It appears this new behaviour is the "intended" behaviour, which makes sense.

It's just a shame it'll be difficult to make my app render correctly in 2.1 and 2.2.

It also seems that if I fiddle with my UINavigationBar transparent/opaque setting I will find some right combination of bugs that will make it appear correctly in both.

Will let you know my findings.

adam
A: 

From the above linked thread:

"Fixed by making my Navigation Bars Opaque (used to be translucent). I think maybe it is a bug fix as this seems logically to me that the view should appear behind a translucent bar."

So yes, it seems to be intended behavior. Makes sense, but bummer, nonetheless!

A: 

I was able to make the positioning of the view while using UIBarStyleTranslucent the same in both 2.1 and 2.2 by doing the following :

Set the view of my viewcontroller to a custom view that I created. Make the custom view extend UIScrollView and in its drawRect method draw a black background and set its contentsize to the size of the view.

I hope this helps = )