0

我对搜索栏有问题。我想让它禁用,但是当我使用 .setEnabled(false) 函数时,我的搜索栏消失了。如何避免这种情况?

我的布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorBackground">

    <SeekBar
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/seekBar"
        />
</LinearLayout>

我的代码:

  SeekBar seekBar=(SeekBar) findViewById(R.id.seekBar);
  seekBar.setEnabled(false);
4

1 回答 1

1

我仍然不知道为什么我的搜索栏消失了,但我在这里找到了另一种禁用搜索栏的方法: https ://stackoverflow.com/a/3278613/4313791

于 2016-10-10T14:55:04.827 回答