【发布时间】:2016-10-03 16:55:35
【问题描述】:
我的搜索栏有问题。我想让它禁用,但是当我使用 .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);
【问题讨论】:
-
我不确定
setEnable(false)是否让搜索栏消失。您应该发布您的布局/代码,以便其他开发人员可以帮助您。 -
我编辑我的帖子。这是我的代码。在此之后我的搜索栏是不可见的,但我只想让它禁用。
标签: java android seekbar mobile-development