【发布时间】:2018-09-05 08:55:43
【问题描述】:
我在 Eclipse 上使用 Android 项目(旧项目)。
我从这里安装 ADT:
https://dl-ssl.google.com/android/eclipse/
在我的 manifest.xml 中
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
xml布局的sn-p:
<Spinner
android:id="@+id/currencySpinner"
style="@style/racommon_spinner_custom_style"
android:layout_width="0dip"
android:layout_height="40dip"
android:layout_weight="0.3"
android:prompt="@string/currency" />
这里是styles.xml
<style name="racommon_spinner_custom_style" parent="@android:style/Widget.Holo.Light.Spinner">
<item name="android:background">@drawable/racommon_spinner_custom_bg</item>
<item name="android:clickable">true</item>
</style>
此处可绘制racommon_spinner_custom_bg:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/spinner_selected_custom_border"/>
<item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/spinner_pressed_custom"/>
<item android:drawable="@drawable/spinner_default_custom" />
</selector>
这里res\drawable-mdpi\spinner_pressed_custom.9.png
如您所见,微调器的背景与 Android 4.0 不同。在安卓 4.0.是正确的微调器的背景。但在 android 6.0+ 中不正确。
为什么?
【问题讨论】:
-
显示
@drawable/spinner_default_custom和其他人的代码 -
@AntonMalyshev "spinner_default_custom" 是 png 文件。这是右下角的黑色三角形
-
看起来阴影渐变渲染不正确。这个看起来怎么样?
spinner_selected_custom_border|另外,您发布的图片是从物理设备还是从 Eclipse 预览软件发布的? -
@HedeH 如果我迁移到 Android Studio,这个问题会解决吗?
-
应该和IDE无关,请发
spinner_selected_custom_border