我想获取 View 类中导航后退按钮的大小。我怎样才能做到这一点?
我可以通过使用获得导航栏的大小,
NavigationController.NavigationBar.Frame;
但是我很难找出后退按钮的大小。
感谢任何帮助!
最佳答案
I want to get the size of the navigation back button in the View class. How can I do that?
您实际上是在寻找导航 Controller 的“NavigationItem”,而不是我一直觉得很奇怪的“NavigationBar”项,但这正是苹果决定实现该属性的方式。
我相信有几种方法可以访问此信息,但这里是获取框架的快速方法。
CGRect frame = NavigationController.NavigationItem.LeftBarButtonItem.CustomView.Frame;
关于ios - 如何在 Xamarin ios 中获取导航栏后退按钮的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45455697/