【问题标题】:Strange behaviour using android.R.layout.simple_dropdown_item_1line使用 android.R.layout.simple_dropdown_item_1line 的奇怪行为
【发布时间】:2011-08-05 13:36:16
【问题描述】:

我在使用 android.R.layout.simple_dropdown_item_1line 时有奇怪的行为 MultiAutoCompleteTextView.

我使用的代码是:

contactId = (MultiAutoCompleteTextView) findViewById(R.id.contactId);
contactAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_item_1line,readContacts());
contactId.setAdapter(contactAdapter);
contactId.setThreshold(1);

我的布局文件包含:

<MultiAutoCompleteTextView
    android:id="@+id/contactId"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="To"
    android:layout_margin="3dip">
</MultiAutoCompleteTextView>

我的模拟器在multiAutoCompleteTextView 上显示白色背景,透明 contactList 里面有信息。

为什么我会有这种奇怪的行为?我正在使用 Android 2.2 进行开发。

【问题讨论】:

  • 再次升级您当前的 Android 2.2

标签: android android-layout android-emulator android-2.2-froyo


【解决方案1】:

我通过更新我的android版本解决了这个问题

【讨论】:

    【解决方案2】:

    我也遇到过同样的问题。 drop down 的内容不会显示在 android 2.2 设备中。 我通过更改drop down 的布局解决了问题

    改变

    android.R.layout.simple_dropdown_item_1line
    

    收件人

    R.layout.support_simple_spinner_dropdown_item
    

    【讨论】:

      猜你喜欢
      • 2019-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-10
      • 2010-10-28
      • 2020-06-24
      相关资源
      最近更新 更多