Note that there are some explanatory texts on larger screens.

plurals
  1. POAntialiasing problem resizing a UIView
    primarykey
    data
    text
    <p>My iPhone app displays a wheel in portrait mode:<br> <img src="https://i.stack.imgur.com/0xkMv.png" alt="enter image description here"></p> <p>When it is rotated to landscape mode it zooms in on the top quadrant of this wheel:<br> <img src="https://i.stack.imgur.com/XNa5Z.png" alt="enter image description here"></p> <p>The way I do this is to create a UIView (bounds: 768 x 768) to house the wheel, then:</p> <pre><code>- (void) layoutSubviews { UIDeviceOrientation O = [UIDevice currentDevice].orientation; : [self repositionWheelTo: O]; } - (void) repositionWheelTo: (UIDeviceOrientation) O { BOOL is_L = UIInterfaceOrientationIsLandscape( O ); CGPoint centerPoint = CGPointFromPoint2D( centreOfRect( self.bounds ) ); float sc = 320.0 / 768.0; if( ! isIPad() &amp;&amp; is_L ) { centerPoint.y += 200; sc *= 2.0; } if( isIPad() ) sc = 1.0; wvContainer.center = centerPoint; wvContainer.transform = CGAffineTransformMakeScale( sc, sc ); } </code></pre> <p>This means it now correctly draws to fit the entire wheel just within the screen on iPad and iPhone-portrait, and on iPhone-landscape it doubles in size.</p> <p>So in iPhone-portrait, you can imagine a 768x768 square that extends around the actual device screen, and the transform is set so that the buttons only get drawn onto the middle section of it.</p> <p>Arguably wasteful of memory, but right now I'm trying to keep the code manageable and I can't see a better way to do it, that lets me transition smoothly between portrait and landscape.</p> <p>Problem is, it looks really mucky on iPhone-portrait. The anti-aliasing just isn't working right. you can see a clear staircase effect on the A in Am that vanishes when it is rotated to landscape.</p> <p>How can I get the wheel to render at an acceptable quality in portrait mode?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload