问题
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