【发布时间】:2017-07-27 13:52:25
【问题描述】:
我尝试在其中一个页面中向我的应用添加导航标题图标,我使用的代码是:
对于 iOS:
NavigationPage.SetTitleIcon(this, "icon.png");
对于 Android,我在 ToolBar.axml 中添加了一个 ImageView,如下所示:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<ImageView
android:id="@+id/titleicon"
android:src="@drawable/UstNameIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>
问题是,我希望我的导航图标在我的下一个页面中被禁用并放置一个标题而不是图标。
为此,我尝试过
对于 iOS:
NavigationPage.SetTitleIcon(this, null);
NavigationPage.Title="Title";
对于Android,如何实现导航标题的改变?
【问题讨论】:
-
我的解决方案对您有用吗?
-
嗨@Anoop,你找到解决方案了吗?
标签: xamarin.forms