Android微调器没有得到欲望的结果
问题描述:
我正在尝试微调从1:http://www.ahotbrew.com/android-dropdown-spinner-example/。Android微调器没有得到欲望的结果
该代码正在工作,但结果不是我想要的。结果是这样的:
但我想微调象下面这样:
不要忘了查看附件。
敏SDK 15,编译SDK 23
答
我的问题是由styles.xml使用自定义主题微调解决:
的main.xml:
<Spinner
android:id="@+id/spThemes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/theme_array"
android:spinnerMode="dropdown"
style="@style/spinner_style"
/>
Styles.xml:
<style name="spinner_style" >
<item name="android:theme">@android:style/Theme.Holo</item>
<item name="android:layout_marginLeft">10dp</item>
<item name="android:layout_marginRight">10dp</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="android:paddingLeft">8dp</item>
<item name="android:paddingTop">5dp</item>
<item name="android:paddingBottom">5dp</item>
<!-- Customize your theme here. -->
</style>
请提供您所写的相关代码。 – Michael
由于应用程序材质外观的原因,您可以获得该外观。您应该尝试遵循材料设计指南。如果你坚持要有自己的外观,请阅读https://guides.codepath.com/android/Developing-Custom-Themes –
结果究竟出了什么问题。难道你不喜欢Caffe Americano而不是Cappucino?它的大小?它是分隔物品的线条吗?还有别的吗? – MikeT