Jon*_*han 2 c# user-interface xamarin xamarin.forms
我正在构建Xamarin.Forms应用,并且需要将导航栏的背景设置为图像。不创建超级自定义商品就可以吗?如果不是,最好的方法是什么?有人做过吗?
这是我需要做的。请注意带有后退按钮,消息图标和“ COMMENTARY”文本的导航栏区域。
有任何想法吗?
使用xamarin不可能更改导航背景图像。对于每个平台,您都必须使用本机。
在Ressources / layout / Toolbar.axml中删除背景色并添加:
android:background="@drawable/yourImage"
2. iOS
在AppDelegate.cs中添加:
UINavigationBar.Appearance.BarTintColor=UIColor.FromPatternImage(UIImage.FromFile("YOURIMAGE.png"));
// To change Text Colors to white here
UINavigationBar.Appearance.TintColor=UIColor.White;
// To change Title Text colors to white here
UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes() { TextColor = UIColor.White});
不要忘记将图像放在不同的资源文件夹中。
希望这对您有所帮助!
| 归档时间: | 
 | 
| 查看次数: | 2981 次 | 
| 最近记录: |