简体   繁体   中英

How can I center UI elements in Xcode 8?

I'm trying to create a login screen, but when I center the elements for one device, it doesn't center them for all devices. How can I center them for all devices in Xcode 8? 在此处输入图片说明

在此处输入图片说明

It will actually be centered at runtime. You just need to update the view's frame in Interface Builder.

Just select the view that's off and click the update button in the lower right corner:

更新框架

If you want Interface Builder to automatically update your frames make sure the Automatically Refresh View option is enabled in Xcode's Editor menu:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM