这就是我所拥有的:
这就是我想要得到的:
如果导航堆栈中没有页面,则标题图标将位于左上角,否则将有后退箭头和“后退”文本。
我没有找到任何自定义它的选项,有可能吗?
如果您使用的话,您可以将箭头更改为汉堡包图标MasterPage
在导航页面内:
Detail = new NavigationPage(masterPage);
如果你想隐藏图标 - 它仅适用于Android。可以使用自定义渲染器来解决(http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/ http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/):
[assembly:ExportRenderer (typeof(NavigationPage), typeof(CustomNavigationRenderer ))]
public class CustomNavigationRenderer : NavigationRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<NavigationPage> e)
{
base.OnElementChanged (e);
var actionBar = ((Activity)Context).ActionBar;
actionBar.SetIcon (Resource.Color.Transparent);
}
}
要更改图标,只需更改项目文件:
- YourProject/Resources/drawable/icon.png
- YourProject/Resources/drawable-hdpi/icon.png
- YourProject/Resources/drawable-xhdpi/icon.png
- YourProject/Resources/drawable-xxhdpi/icon.png
或在你的MasterDetailPage
set Icon
属性到另一个资源。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)