您的位置:首页 > 移动开发 > IOS开发

Add more Button to Nav Bar xamarin.ios

2016-03-04 10:31 337 查看
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 };
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: