Search code examples
ioscocoa-touchinterface-builderretina-display

How to correctly handle pixels in Interface Builder?


How can I in a right way work with pixel dimensions in Interface Builder? E.g i have an image mockup where all dimensions and sizes in pixels : "this button has margin from the left - 30 pixels e.g. and this textfield is 100 pixels long and so on".So if I develop for Retina i need to set margin 60 pt or not? And in IB there are only Retina 3.5 and Retina 4 and there is no non-Retina. So what is a right way to handle retina and non retina screens in IB?How to correctly set dimensions for UI elements?


Solution

  • Most likely you're working with logical points and not pixels at all. That's why you shouldn't worry about retina and non retina since iOS is going to translate logical points to pixels at runtime.

    What do you mean when you say

    in IB there are only Retina 3.5 and Retina 4 and there is no non-Retina