Add more Button to Nav Bar xamarin.ios

来源:互联网 发布:centos snmpwalk 编辑:程序博客网 时间:2024/06/06 04:10
this.Title = "Inspection";
this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes ()

ForegroundColor=UIColor.White
};
this.NavigationController.NavigationBar.TintColor = UIColor.White;
this.NavigationController.NavigationBar.BarTintColor = UIColor.FromRGB (85,116,163);
this.NavigationController.NavigationBar.Translucent = false;
this.NavigationController.NavigationBarHidden = false;
this.NavigationController.NavigationBar.BarStyle = UIBarStyle.BlackTranslucent;


            var customButton = new UIBarButtonItem(
            UIImage.FromFile("ic_camera_alt_white_48dp.png"),
            UIBarButtonItemStyle.Plain,
            (s, e) => {
                System.Diagnostics.Debug.WriteLine("button tapped");
            }
            );
            
            var customButton2 = new UIBarButtonItem(
           UIImage.FromFile("mic_attach_file_white_48dp.png"),
           UIBarButtonItemStyle.Plain,
           (s, e) => {
               System.Diagnostics.Debug.WriteLine("button tapped");
           }
           );
            var customButton3 = new UIBarButtonItem(
           UIImage.FromFile("ic_save_white_48dp.png"),
           UIBarButtonItemStyle.Plain,
           (s, e) =>
           {
               System.Diagnostics.Debug.WriteLine("button tapped");
           }
           );
            NavigationItem.RightBarButtonItems= new UIBarButtonItem[] { customButton, customButton2 ,customButton3 };
0 0
原创粉丝点击