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