Exemple #1
0
        void CommonInit()
        {
            fhvc = new MDCFlexibleHeaderViewController();
            AddChildViewController(fhvc);

            CGRect imageViewFrame = fhvc.HeaderView.Bounds;

            imageView = new UIImageView(imageViewFrame);

            imageView.ContentMode      = UIViewContentMode.ScaleAspectFill;
            imageView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth |
                                         UIViewAutoresizing.FlexibleHeight;

            fhvc.HeaderView.AddSubview(imageView);

            appBar = new MDCAppBar();
            AddChildViewController(appBar.HeaderViewController);

            appBar.HeaderViewController.HeaderView.BackgroundColor = UIColor.Clear;
            appBar.NavigationBar.TintColor = UIColor.White;

            var backButton = new UIBarButtonItem("", UIBarButtonItemStyle.Done, DidTapBack);

            var backImage = UIImage.FromBundle("Back");

            backButton.Image = backImage;
            NavigationItem.LeftBarButtonItem = backButton;
        }