UITableViewCell with autolayout left margin different on iPhone and iPad

后端 未结 5 934
臣服心动
臣服心动 2020-11-28 19:47

I am using a grouped UITableView with static cells for an options screen/scene. Everything is done in Xcode 6.1 / iOS 8.1.x / Storyboard using Autolayout. Withi

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 20:00

    I was able to get cells with custom styles aligned with the standard cells by doing the following:

    1. In the Document Outline, select the "Content View" for the cell with the custom style.
    2. Go to the Size Inspector.
    3. Under the "Layout Margins" dropdown, hit the little plus symbol next to "Preserve Superview Margins."
    4. Select the iPad size class, which is "Regular Width x Regular Height."
    5. Check the checkbox next to "Preserve Superview Margins."
    6. Resolve any Auto Layout warnings by updating the frames.

    This worked for me in Xcode 7; I'm hoping it will work in Xcode 6 as well.

提交回复
热议问题