矢量绘图在某些设备上无法正确显示

问题描述

我只是用矢量drawables替换了我应用程序中的png drawables,这似乎在大多数设备上都可以正常工作,但是由于某些原因,我在运行Android 8的Samsung S8的某些随机图标上遇到了奇怪的显示。 一些图标以像素化的轮廓显示,我不知道为什么我测试了完全相同的APK或其他10个设备时没有任何问题。

例如,在以下布局中,第一个图标(上一个音轨)有此问题,而其他图标则无此问题。 如果我更改此图标的可绘制矢量,它仍然会显示问题。 知道是什么原因造成的吗?

   <LinearLayout
            android:id="@+id/streamControlsLayout"
            android:layout_width="match_parent"
            android:layout_height="62dp"
            android:layout_gravity="center"
            android:gravity="center"
            android:orientation="horizontal" >

            <ImageButton
                android:id="@+id/prevIoUsTrack"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:contentDescription="@string/prevIoUsTrackButtonContentDescription"
                android:padding="6dp"
                android:scaleType="fitCenter"
                android:src="@drawable/prevIoUs_track_button" >
            </ImageButton>

            <ImageButton
                android:id="@+id/rewind"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:contentDescription="@string/fastRewindTrackButtonContentDescription"
                android:padding="6dp"
                android:scaleType="fitCenter"
                android:src="@drawable/rewind_button" />

            <ImageButton
                android:id="@+id/playButton"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:contentDescription="@string/playPauseButtonContentDescription"
                android:scaleType="fitCenter"
                android:src="@drawable/play_button" >
            </ImageButton>

            <ImageButton
                android:id="@+id/fastForward"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:contentDescription="@string/fastForwardButtonContentDescription"
                android:padding="6dp"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_fast_forward" />

            <ImageButton
                android:id="@+id/nextTrack"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="?attr/selectableItemBackgroundBorderless"
                android:contentDescription="@string/nextTrackButtonContentDescription"
                android:padding="6dp"
                android:scaleType="fitCenter"
                android:src="@drawable/next_track_button" >
            </ImageButton>
        </LinearLayout>

问题示例

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)