Android 没有可单击的编辑文本视图
我花了很多时间做实验,但我不能让它工作。无法单击添加到线性布局中的任何类型的编辑文本。奇怪的是它看起来很集中(我把它放在代码中)。 我甚至无法让键盘弹出,wierd部分是如果我隐藏它并使具有相同属性的微调器可见-微调器的弹出窗口工作。 注意:下面是AutoCmleTextBox,但当它只是EditTextBox时,我注释掉了-适配器的东西。还是不起作用,甚至没有弹出键盘 这是我的密码Android 没有可单击的编辑文本视图,android,android-layout,android-edittext,Android,Android Layout,Android Edittext,我花了很多时间做实验,但我不能让它工作。无法单击添加到线性布局中的任何类型的编辑文本。奇怪的是它看起来很集中(我把它放在代码中)。 我甚至无法让键盘弹出,wierd部分是如果我隐藏它并使具有相同属性的微调器可见-微调器的弹出窗口工作。 注意:下面是AutoCmleTextBox,但当它只是EditTextBox时,我注释掉了-适配器的东西。还是不起作用,甚至没有弹出键盘 这是我的密码 <LinearLayout xmlns:android="http://schemas.android.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
tools:context="com.example.edu.testversion.activity.CategoryChooser"
tools:ignore="MergeRootFrame"
android:id="@+id/frameLayout"
android:orientation="horizontal">
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:text="@string/button_start_map"
android:id="@+id/play_game_button"
android:layout_gravity="right|top"
android:theme="@style/AppTheme"
android:layout_marginTop="10dip"
android:visibility="gone" />
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/game_spinner"
android:layout_gravity="left"
android:spinnerMode="dialog"
android:theme="@style/AppTheme"
android:layout_marginTop="5dip"
android:visibility="gone" />
<TextView
android:layout_width="fill_parent"
android:layout_height="47dp"
android:text="Which way do you want to play the game?"
android:layout_gravity="center_vertical"
android:id="@+id/get_started_dialog"
android:typeface="monospace"
android:singleLine="false"
android:textIsSelectable="false"
android:textSize="@dimen/activity_horizontal_margin"
android:layout_marginLeft="5dp"
android:clickable="false"
android:enabled="false"
android:focusable="false"
android:textAlignment="textEnd"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:minHeight="20dip"
android:id="@+id/restaurant_name_display"
android:typeface="monospace"
android:singleLine="false"
android:textIsSelectable="false"
android:textSize="@dimen/activity_horizontal_margin"
android:layout_marginLeft="5dp"
android:clickable="true"
android:visibility="gone"
android:enabled="false"
android:focusable="false"
android:textAlignment="textEnd"
android:layout_marginTop="3dp" />
<AutoCompleteTextView
android:completionThreshold="3"
android:textIsSelectable="true"
android:id="@+id/find_location_dropdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:minWidth="160dip"/>
<!--android:layout_gravity="center_vertical"
android:typeface="monospace"
android:textSize="@dimen/activity_horizontal_margin"
android:layout_marginLeft="5dp"
android:textAlignment="textEnd"
android:visibility="gone"
android:layout_marginTop="3dp" />
-->
</LinearLayout>
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="416dp"
class="com.google.android.gms.maps.MapFragment"
android:layout_weight="3.25" />
唯一涉及它的代码是在我的oncreate中:
mAutocompleteLocation = (AutoCompleteTextView) findViewById(R.id.find_location_dropdown);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line,androidBooks);
mAutocompleteLocation.setThreshold(3);
mAutocompleteLocation.setAdapter(adapter);
mAutocompleteLocation.setCompletionHint("FUN!");
mAutocompleteLocation.setFocusable(true);
mAutocompleteLocation.setClickable(true);
mAutocompleteLocation.setVisibility(View.VISIBLE);
mAutocompleteLocation=(AutoCompleteTextView)findViewById(R.id.find\u location\u下拉列表);
ArrayAdapter=新的ArrayAdapter(这是android.R.layout.simple\u下拉列表\u item\u 1line,androidBooks);
mAutocompleteLocation.setThreshold(3);
mAutocompleteLocation.setAdapter(适配器);
mAutocompleteLocation.setCompletionHint(“有趣!”);
mAutocompleteLocation.setFocusable(true);
mAutocompleteLocation.setClickable(真);
mAutocompleteLocation.setVisibility(View.VISIBLE);
删除自动完成文本中的这一行查看一切正常
android:textIsSelectable="true"
非常感谢。为什么textIsSelectable让它无法工作?它的功能是什么?它可能与覆盖手势输入的属性有关,这就是为什么当你点击它时,它没有响应。不过,您不需要它,它只用于文本视图。您只需长按即可选择编辑文本内容。请修复您的xml代码。存在错误,并且您的屏幕截图与代码不完全相同。