更新时间:2023-01-02 18:23:00
您可以使用自定义渲染器:
You could do it with custom renderer:
[assembly:ExportRenderer (typeof(NavigationPage), typeof(NavigationPageRenderer))]
namespace SuperForms.Samples.Droid
{
public class NavigationPageRenderer : NavigationRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<NavigationPage> e)
{
base.OnElementChanged(e);
var actionBar = ((Activity)Context).ActionBar;
actionBar.SetIcon(Resource.Drawable.newIcon);
}
}
}
将图标添加到Resources/drawable
文件夹:
外观如何: