Reliably getting the screen scale
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