Forum Xamarin.iOS

Selection line not displaying on custom cells in UITableView?

GlayzuGlayzu IEMember ✭✭

Some tables in my app feature custom cells with background colors. For some reason these don't draw the single-selector line that the rest of the cells display.

I replicated the effect by adding two UIViews of height 1.0f, these display the same, however it just occurred to me that these vanish when I rotate the device.

I'm calling the following with the constructor of the Cell.
UIView topLine = new UIView(new CGRect(0,Frame.Height, 768, 0.5f);

There must be a better way to achieve this?


  • GlayzuGlayzu IEMember ✭✭
    edited May 2015

    Fixed the issue, just had to set layout in LayoutSubviews.

    public override void LayoutSubviews()
      topLine = new UIView(new CGRect(0,Frame.Height,768,0.5f);
Sign In or Register to comment.