MonoTouch 获取UIBarButtonItem的位置

这只是一个事例。

在这个例子中,先在NavigationController 中找UIView,然后在找到的位置,用一个UIView覆盖它。

        UIView view = null;
            foreach (UIView subview in this.NavigationController.NavigationBar) {
                if (subview is UIControl) {
                    Console.WriteLine (subview.ToString ());
                    Console.WriteLine (subview.Frame);
                    view = new UIView (subview.Frame)
                    {
                        BackgroundColor = UIColor.Black
                    };
                    break;
                }
            }

            if (view!=null)
            this.NavigationController.NavigationBar.Add (view);
欢迎到我的网站看看
原文地址:https://www.cnblogs.com/Caiyinsoft/p/3459200.html