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 };
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 };
相关文章推荐
- 如何成为一名优秀的iOS开发工程师
- ios页面间跳转方式总结
- iOS内存管理基础
- iOS Drawing Performance
- iOS中NSTimer的invalidate调用之后
- iOS中NSTimer的invalidate调用之后
- iOS学习笔记68-IOS移除NSAssert& NSLog
- iOS中NSTimer的invalidate调用之后
- CADisplayLink简单应用
- iOS开发 CycleScrollView 轮播图的实现
- iOS CoreData数据迁移-默认迁移方式
- iOS SDK9在Xcode7下免证书真机测试及常见问题
- 一个ios工程师必须具备的八大知识技能点
- nagios监控搭建
- iOS 3D Touch功能
- iOS开发中方法延迟执行的几种方式-简书
- IOS指纹识别调用
- iOS Push & pop
- iOS - App内使用代码退出程序
- iOS应用开发中监听键盘事件的代码实例小结