View As different device misplaces centered label within prototype cell in Interface Builder

大城市里の小女人 提交于 2019-12-11 18:26:17

问题


Using Xcode 10.1, I create a tableview on my main storyboard. In the prototype cell, I place a text label. I then create constraints to match it's center with its superview center, both horizontally and vertically. So the label should be centered in the cell. All looks good. When I choose "View as" a different device, it is misaligned horizontally. However when I run in the simulator, it appears to be working OK. Is this an Xcode bug or is there something I'm not understanding about the way interface builder works and displays the label?

来源:https://stackoverflow.com/questions/54524507/view-as-different-device-misplaces-centered-label-within-prototype-cell-in-inter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!