1
我使用此代碼爲xamarin中的操作欄創建菜單。但正在顯示文字,而不是圖標。我只想出現圖標。這是我嘗試創建菜單。xamarin充氣菜單操作欄圖標不顯示,只顯示文本
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/android-auto">
<item android:id="@+id/action_reply"
android:icon="@drawable/ic_rotate"
android:title="Reply"
android:showAsAction="always" />
<item android:id="@+id/action_undo"
android:icon="@drawable/ic_dashboard"
android:title="Undo"
android:showAsAction="never" />
</menu>
這裏是行動條碼
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FEFEFE">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:layout_alignParentTop="true" />
任何人都可以提出一些改進?
我也得到這個問題,總是得到的菜單圖標,而不是圖標。你找到解決方案嗎? – Carl
同樣的問題,有什麼進展? – cfl
@Charl我發現我的解決方案與此答案:http://stackoverflow.com/questions/25744146/action-bar-icon-not-showing-in-android-action-bar/25744230#25744230 – cfl