I am having a problem with my UITableViewCell\'s appearance on the iPad. This problem arose sometime between iOS 7 and now, but I don\'t know for sure when it started. On an iPo
Try this code:
protected void Draw()
{
Accessory = UITableViewCellAccessory.DisclosureIndicator;
Layer.BorderColor = UIColor.Green.CGColor;
Layer.BorderWidth = 1f;
Frame = new CGRect(0, 0, [UIApplication sharedApplication].keywindow.frame.size.width, 42);
ContentMode = UIViewContentMode.ScaleToFill;
AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
ContentView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
ContentView.MultipleTouchEnabled = true;
ContentView.ContentMode = UIViewContentMode.Center;
ContentView.ClipsToBounds = true;
ContentView.Layer.BorderColor = UIColor.Brown.CGColor;
ContentView.Layer.BorderWidth = 1f;
}
public override void LayoutSubviews()
{
base.LayoutSubviews();
//!! - Hack for ipad layout issue with disclosure indicator
if (Accessory == UITableViewCellAccessory.DisclosureIndicator && UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
{
ContentView.Frame = new CGRect(0, 0, [UIApplication sharedApplication].keywindow.frame.size.width - 32, ContentView.Frame.Size.Height);
foreach (var view in Subviews.OfType())
{
view.Frame = new CGRect([UIApplication sharedApplication].keywindow.frame.size.width - 24, view.Frame.Y, 8, view.Frame.Height);
}
}
}