Skip to content

Can't see error text when field in table view cell #6

Open

Description

@amphora-ken

First off, thanks for writing and publishing this!

When I add error text to a field, the underline turns red, but I cannot see the error text. If I use Reveal to look at the views, the text is there, but hidden.
The field is attached to all 4 sides of the content view of the cell, and the cell should grow based on autolayout (height methods return UITableViewAutomaticDimension).
Any thoughts on how to get this to work? I also tried changing the error padding, but no help.
Thanks

Activity

  1. stephsharp commented on Mar 15, 2016

    @stephsharp
    Owner

    Thanks for raising this issue.

    Looks like it's a problem with dynamic height tableview cells. I had a play around with it on the weekend but couldn't get it to work the way it should. I would like to improve the way I'm setting up constraints on the error label, so I'll have a go at that when I get the time over the next few weeks. (I'm moving overseas so I'm a bit busy right now!)

    As a workaround in the mean time, instead of returning UITableViewAutomaticDimension from tableView:heightForRowAtIndexPath:, calculate the height of the cell using the textfield's intrinsic content size. This seemed to work ok for me. For example:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
            return self.textField.intrinsicContentSize.height;
    }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions