Functionality of the cells in DialogViewController

ArthasonArthason USUniversity
edited October 2015 in Xamarin.iOS

i try to add a custom cell view to my DialogViewController
My code looks like

        var testCell = testCellView.Create ();
        var root = new RootElement ("") {
                    new Section () {

                        new UIViewElement("", testCell, false),
                    }
                };

                _rootVC = new DialogViewController (UITableViewStyle.Plain, root);

                this.AddChildViewController (_rootVC);
                this.View.AddSubview (_rootVC.View);

                this.View.ConstrainLayout (() =>
                    _rootVC.View.Frame.Top == this.View.Frame.Top &&
                    _rootVC.View.Frame.Bottom == this.View.Frame.Bottom &&
                    _rootVC.View.Frame.Left == this.View.Frame.Left &&
                    _rootVC.View.Frame.Right == this.View.Frame.Right
                );

and here is the code of the custom view

        public partial class testCellView : SWTableViewCell.SWTableViewCell
            {
                public static readonly UINib Nib = UINib.FromName ("testCellView", NSBundle.MainBundle);
                public static readonly NSString Key = new NSString ("testCellView");

                public testCellView (IntPtr handle) : base (handle)
                {
                }

                public static testCellView Create ()
                {           
                    return (Profile_UsersHead)Nib.Instantiate (null, null) [0];
                }
            }

image

My Problem ist that the custom view hasn't the full width of the View. On the right side there is a spacing (its for the UIElements that BooleanElement's has). Does someone has an idea how to get the element to the full width ?

Sign In or Register to comment.