简体   繁体   中英

UILabel text alignment only working in iOS simulator

I've created a custom cell with several UILabels and everything works great, but for some reason I can't seem to get the text in any of my labels to do anything other than center.

Everything was created in Storyboard, and I set the left-alignment attribute, it looks perfect in the simulator, but when I test my code on my iPhone, all the labels center.

Since it's all in Storyboard, there isn't really any code snippet I can share, is there something I'm missing?

Did You remove app from device ? sometimes when adding/testing style features, old style is appended, until You delete the app.

Do one or both of the following:

  1. Remove the app from your device and re-build it onto the device
  2. Remove the folders in the DerivedData associated with your app. By default, the DerivedData folder is is located at /Library/Developer/Xcode/DerivedData/

This usually fixes all the Ui-related issues I've come across.

原来,自动版式正在改变我单元格中Labels的大小,将其关闭似乎现在已经解决了该问题。

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