【发布时间】:2015-02-08 17:49:55
【问题描述】:
我有一个简单的微调器代码,在我的 PC 中 Android API 更新为 lollipop 而我的同事 PC 更新为 kitkat,但 UI显示如下,为什么会这样
棒棒糖
奇巧
activity.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#cfcfcf"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical">
<Spinner
android:id="@+id/spinner1"
android:layout_width="match_parent"
android:entries="@array/arr"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
Style.xml
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
<item name="android:spinnerItemStyle">@style/mySpinnerItemStyle</item>
<item name="android:spinnerDropDownItemStyle">@style/mySpinnerItemStyle</item>
</style>
<style name="mySpinnerItemStyle" parent="@android:style/Widget.Holo.DropDownItem.Spinner">
<item name="android:textSize">15sp</item>
<item name="android:textColor">#00ff00</item>
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
【问题讨论】:
标签: android styles android-spinner android-4.4-kitkat android-5.0-lollipop