A
A
Aitym Ramazanov2015-01-02 09:07:35
Apple Xcode
Aitym Ramazanov, 2015-01-02 09:07:35

Why is the inscription not centered?

In general, I began to study programming for iOS. In XCode, I put the inscription in the center, I start the simulator, and there the inscription is not in the center. I suspect that the size of the iPhone is incorrectly determined in the stimulator.
XCode version: 7.2. I choose iPhone 6s Plus in XCode. I don’t have an iPhone yet, I’ll have to check everything in the simulator. Here is the screenshot:
58cc19a016f74a49b224ce9dff6fe777.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Bashkatov, 2015-01-02
@iTeam1991

You have centered the inscription according to the dimensions of the work area (in your example - a square) in absolute coordinates. That is, if it is set to (200, 200) in Xcode, then it will be set to the same point on the emulator at startup. To align to the center in relative coordinates, that is, on any screen size, you need to add constraints, read about Auto Layout, they can be set visually directly in Xcode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question