• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reliably getting the screen scale
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reliably getting the screen scale


  • Subject: Reliably getting the screen scale
  • From: Rick Mann <email@hidden>
  • Date: Fri, 16 Aug 2013 15:26:59 -0700

I have a custom view that creates a mask image in -layoutSubviews. It uses the screen scale in order to render the image at the best possible resolution.

But -layoutSubviews is getting called before the view has a window, so I can't get the view's screen. I could use the mainScreen, but that might not be correct if there are additional screens.

-layoutSubviews is not called when the view finally gets a window. Should I override setWindow: and call setNeedsLayout? What's the best way to handle this?

TIA,

--
Rick




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Reliably getting the screen scale
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: After popping view controller, table view scrolls sideways
  • Next by Date: Re: Reliably getting the screen scale
  • Previous by thread: Re: Is it OK to setKeyEquivalent during validateMenuItem
  • Next by thread: Re: Reliably getting the screen scale
  • Index(es):
    • Date
    • Thread