Manually building GUI and Retina Macs
Manually building GUI and Retina Macs
- Subject: Manually building GUI and Retina Macs
- From: Andreas Falkenhahn <email@hidden>
- Date: Mon, 09 Jan 2017 17:13:12 +0100
I'm building some windows and controls in my app by manually
creating NSWindow objects and the respective controls and then
adding them to the NSWindow by using
[[win contentView] addSubview:control];
The control and window sizes and their positions are all hard-coded
in pixels. Thus, it is assumed that the UI font size stays the
same.
Now I was wondering how such code will behave on Retina Macs?
Will it mess up completely because I use hard-coded position
and size values but the font on Retina Mac is bigger? I don't
have a Retina Mac here so can somebody explain (or point me to
some documents) how to write code that scales nicely on Retina
Macs?
I'm familiar with Retina development on iOS. On iOS, position and
size on Retina and Non-Retina devices are basically the same.
To solve the problem of higher resolutions, there is a scale
coefficient that can be queried by looking into "UIScreen.scale".
This way apps written for non-Retina devices normally just work
on Retina devices. Do Retina Macs use a similar implementation?
Is there any way to test if my app runs nicely on a Retina Mac
without actually having a Retina Mac?
--
Best regards,
Andreas Falkenhahn mailto:email@hidden
_______________________________________________
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