Skip to content

Inconsistent margins on devices wider than iPhone 4 #259

@jlnr

Description

@jlnr

We have noticed inconsistent left and right margins on iPhone 6+ and iPad, and tracked them down to this spot:

- (void)layoutDetailView:(UIView *)view minimumWidth:(CGFloat)minimumWidth
{
CGFloat cellOffset = 10.0;
CGFloat fieldOffset = 10.0;
if (self.section.style.contentViewMargin <= 0)
cellOffset += 5.0;

I guess this was written under the assumption that the default left margin for table cells is always 10.0, which is only true on the smaller iPhone models. We have worked around this issue in our fork by changing the method like this:

jlnr@90fb0b3

I guess one could also fix the inconsistency by resizing self.textLabel, which iOS provides by default, to match the size and margins of RETableViewManager’s custom views. But we want our app to look as native as possible.

This is not ready for a Pull Request because the cellOffset of 10.0 also appears in other cell types which we don't use and haven't tested, and I don't know if we have broken the way the contentViewMargin works.

If you compare the before/after screenshots of the example on iPhone 6+ and iPad, it really looks much more consistent. This is possibly related to issues #249 and #115.

iPhone 6 Plus, before

iphone6plus-before

iPhone 6 Plus, after

iphone6plus-after

iPad, before

ipad-before

iPad, after

ipad-after

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions