微调下拉中的Nexus弹出仓位变化5(是Android 5.0) [英] Spinner drop down popup position changes in Nexus 5 (android 5.0)

查看:199
本文介绍了微调下拉中的Nexus弹出仓位变化5(是Android 5.0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用我的应用程序好手。我使用的基本微调,这是我的code:`

I am using a Spinner in my app. I used the basic spinner and this is my code:`

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    style="@style/SpinnerSpinnerTheme"
    android:spinnerMode="dropdown"
    android:layout_gravity="center_vertical"
    android:id="@+id/hj_order_date_spinner"
    />`

这是我在活动如何实例

and this is how i instantiated in my activity

 ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,R.array.hj_spinner_items,android.R.layout.simple_spinner_item);
   adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    dateSpinner.setPrompt("Sort By");
    dateSpinner.setAdapter(adapter);

这在安卓4.4.4,但在Nexus 5(使用棒棒堂)下拉列表中工作正常/弹出改变它的立场和隐藏排序依据栏还是原来的微调。
任何人都可以提供任何见解,以可能是什么问题?

This works fine in android 4.4.4 but on Nexus 5(using Lollipop) the drop down list/Popup changes it's position and hides the "Sort By" bar or the original spinner. Can anyone provide any insight as to what might be the issue?

推荐答案

您可以指定微调下拉是否应该使用 Android的重叠锚:overlapAnchor 属性。当使用材料微调的风格,这个属性默认为真正

You can specify whether the spinner drop-down should overlap the anchor by using the android:overlapAnchor attribute. When using the Material spinner style, this attribute defaults to true.

<Spinner
    ...
    android:overlapAnchor="false" />

这篇关于微调下拉中的Nexus弹出仓位变化5(是Android 5.0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆