iphone - Working with Landscape Views designed with interface builder -
iphone - Working with Landscape Views designed with interface builder -
i'm trying understand , googling around, seems bug in iphone sdk, maybe hidden im not sure of.
i designed new view in interface builder, in landscape mode. looks this:
but when load in 1 of other views, though landscape, content doesnt looks within interface builder, looks this:
i found code in google helped sort-of prepare issue, solution isn't perfect , , kind of ugly workaround, code (in viewdidload):
class="lang-cpp prettyprint-override">// first rotate screen: [uiapplication sharedapplication].statusbarorientation = uiinterfaceorientationlandscaperight; // rotate view , re-align it: cgaffinetransform landscapetransform = cgaffinetransformmakerotation( 1.570796327 ); // 90 degrees in radian [self.view settransform:landscapetransform]; this code solves problem, still doesn't xib:
i'd love know if of creative minds have improve solution this, , if not, if can help me alter code above maybe come closer "original" design in xib file.
thanks in advance! :) shai.
the reason view beingness pushed because it's starting in left top corner behind status bar. seek adding after rotation:
landscapetransform = cgaffinetransformmaketranslation(0, 20); [self.view settransform:landscapetransform]; iphone view rotation landscape
Comments
Post a Comment