예제 #1
0
        protected virtual void UpdateTitleView()
        {
            var titleView = Shell.GetTitleView(Page);

            if (titleView == null)
            {
                var view = NavigationItem.TitleView;
                NavigationItem.TitleView = null;
                view?.Dispose();
            }
            else
            {
                var view = new TitleViewContainer(titleView);

                if (Forms.IsiOS11OrNewer)
                {
                    view.TranslatesAutoresizingMaskIntoConstraints = false;
                }
                else
                {
                    view.TranslatesAutoresizingMaskIntoConstraints = true;
                    view.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
                }

                NavigationItem.TitleView = view;
            }
        }
예제 #2
0
        protected virtual void UpdateTitleView()
        {
            var titleView = _context.Shell.GetEffectiveValue <View>(Shell.TitleViewProperty, () => Shell.GetTitleView(_context.Shell), null, Page);

            if (titleView == null)
            {
                var view = NavigationItem.TitleView;
                NavigationItem.TitleView = null;
                view?.Dispose();
            }
            else
            {
                var view = new TitleViewContainer(titleView);
                NavigationItem.TitleView = view;
            }
        }
        protected virtual void UpdateTitleView()
        {
            var titleView = Shell.GetTitleView(Page);

            if (titleView == null)
            {
                var view = NavigationItem.TitleView;
                NavigationItem.TitleView = null;
                view?.Dispose();
            }
            else
            {
                var view = new TitleViewContainer(titleView);
                NavigationItem.TitleView = view;
            }
        }
예제 #4
0
        protected virtual void UpdateTitleView()
        {
            var titleView = _context.Shell.Toolbar.TitleView as View;

            if (NavigationItem.TitleView is TitleViewContainer tvc &&
                tvc.View == titleView)
            {
                return;
            }

            if (titleView == null)
            {
                var view = NavigationItem.TitleView;
                NavigationItem.TitleView = null;
                view?.Dispose();
            }
            else
            {
                var view = new TitleViewContainer(titleView);
                NavigationItem.TitleView = view;
            }
        }