Android MenuAction按钮的宽高比错误

时间:2018-01-17 11:42:56

标签: android android-menu

菜单上的操作按钮的宽高比错误。虽然它不是图片视图,但我无法在其上设置scaleType或其他任何内容。

它已经工作多年了,现在已经发布了Android 8 ,并且我已经增加了这样的tar版本和构建SDK版本。

“ic_gps_fixed_white_48dp”是一个可绘制的实际PNG,适用于所有屏幕密度(hdpi,xhdpi等等)

有什么想法吗?

menu xml:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.example.toolbar.MainActivity">


    <item
        android:id="@+id/my_location_menu_btn"
        android:icon="@drawable/ic_gps_fixed_white_48dp"
        android:title=""
        app:showAsAction="always" />


</menu>

enter image description here

0 个答案:

没有答案