0

When you create a dialog similar to the one below

this one works fine

And then navigate to a new view controller by tapping on a radiobutton group (in my example industry type), then return back your labels are endinf up overlapping the text. Tested on simulator and Apple iPad mini 2.

Has anyone found a way to fix this without creating a custom class ?

labels overlapping

RomanG
  • 128
  • 7

1 Answers1

0

The only way was to create a new class and explicitly specify constraints by overriding GetCell method:

public class BaseEntryElement:EntryElement
{
.....
public override UITableViewCell GetCell (UITableView tv)
        {

            var c= base.GetCell (tv);
    c.ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints ();
            c.ContentView.AddConstraints (
                c.ContentView.Subviews[0].WithSameCenterY(c.ContentView),
                c.ContentView.Subviews[0].AtLeftOf(c.ContentView,BaseEntryElement.offset),
                c.ContentView.Subviews[0].AtTopOf(c.ContentView),
                c.ContentView.Subviews[1].ToRightOf(c.ContentView.Subviews[0],40),
                c.ContentView.Subviews[1].WithSameCenterY(c.ContentView.Subviews[0])
            );
    return c;    
}
}
RomanG
  • 128
  • 7