android - 微调器将项目显示为下拉列表

标签 android android-layout spinner android-spinner

我在选项卡布局内调用的 Activity 中制作了一个微调器。
问题是项目(数量为 3)显示在单独的对话框中,就像下拉列表的情况一样不是作为旋转器。

我关注了this例子。正如我期待的图片所示
this
但我得到这个:
this
&这个
this .

我只想在微调器内显示 3 个项目,并且不希望选择这些项目的新对话框。我已经在 2.3.3 和 4.0.3 模拟器上尝试过我的代码。

有什么建议吗?
谢谢

最佳答案

作为下拉菜单的微调器是 HOLO 主题。第一张图片是 HOLO 主题,第二张和第三张不是。. 自 api 级别 11 起支持 Holo 主题..

如果你想应用Holo主题。设置

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17" />
values-v11文件夹内的

styles.XML

<resources>

<!--
    Base application theme for API 11+. This theme completely replaces
    AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
    <!-- API 11 theme customizations can go here. -->
</style>

values文件夹内的

styles.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="android:Theme.Light.NoTitleBar">
    <!--
        Theme customizations available in newer API levels can go in
        res/values-vXX/styles.xml, while customizations related to
        backward-compatibility can go here.
    -->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>


 <style name="progressbar_holo" parent="@android:style/Theme.Light">
</style>

以及AndroidMeanifeast.xml

android:theme="@style/AppTheme"

应用程序标签中。

关注这2个链接 1.https://github.com/ChristopheVersieux/HoloEverywhere
2.https://github.com/ChristopheVersieux/HoloEverywhere

关于android - 微调器将项目显示为下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14214001/

相关文章:

android - ListView 与线性布局

Android:ImageView、LinearLayout 和TextView 高度返回负值,0 和0,为什么?

android - 在 Iphone 上使用数据库,就像在 android 上使用微调器一样

android - 选择为 textView 和 editText 添加边框形状时,

python - 向 Kivy 添加小部件时如何确保功能正常

android - 微调器中的图像+ TextView +单选按钮

android - 使用 Camera 和 getOptimalPreviewSize 扭曲的图片

java - 从Android 2.1瞄准Android 1.6平台

android - 实现MultiDex导致编译了这么久,最后heap space error

android - Android Flow虚拟布局可以处理可变宽度的 View 吗