xamarin.iOS 导航栏添加按钮

导航栏添加按钮,打开侧边栏
private void OpenSideView()
{
方法一:
var rightButton = new UIBarButtonItem(UIImage.FromFile(“Image/mdpi/ic_menu_search_holo_dark”), UIBarButtonItemStyle.Done, (s, e) =>
{
var sideMenu = Mvx.Resolve();
sideMenu?.Open(MvxPanelEnum.Right);
});
NavigationItem.RightBarButtonItem = rightButton;

方法二(推荐):
NavigationItem.SetRightBarButtonItem(
new UIBarButtonItem(UIBarButtonSystemItem.Search, (sender, args) =>
{
var sideMenu = Mvx.Resolve();
sideMenu?.Open(MvxPanelEnum.Right);
})
, true);
}

你可能感兴趣的:(边缘滑动-侧边栏,导航栏按钮-侧边栏)