Android: Distorted background for toolbar icons, list items and overflow menu

非 Y 不嫁゛ 提交于 2019-12-13 05:37:34

问题


While developing an android app, i updated android studio and also android sdk. after that, i faced strange behavior. when clicking on any item like actionbar icons, overflow menu and spinners get distorted background like picture below.

my sdk versions are:

Android support repository 32

Android support library 23.2.1

Android SDK tools 25.1.6

Android SDK Build-tools 23.0.2

Android 6.0 (API 23)

SDK platform Rev 3

its same on emulator and usb device, and cleaning and rebuilding the project didn't solved the problem.

Also, i have not put any code in style.xml to customize these items and i use the android default styles.


回答1:


finally i found the answer after a week of challenging and asking here:

i was using android gradle plugin 2.2.0-alpha and the problem was rised from that. i didn't know that it can be the source of such problem.

after returning to gradle plugin 2.1.0 the problem solved!




回答2:


Try using android:stateListAnimator="@null" and android:background="@null" for the spinners and buttons



来源:https://stackoverflow.com/questions/37629817/android-distorted-background-for-toolbar-icons-list-items-and-overflow-menu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!