如何解决矢量绘图在某些设备上无法正确显示
我只是用矢量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>
问题示例
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。