【发布时间】:2018-03-08 03:15:25
【问题描述】:
我已经为调查创建了一个弹出窗口的布局,但不知何故,当焦点为真时,即使在点击编辑文本后也不显示键盘...
在其他活动中,所有 EditText 都正常工作。
最近,我将 app Theme 更改为 AppCompat 以实现 Material 组件。我不确定它是否会产生影响,但我没有任何想法,为什么它不起作用。
有什么想法吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#66ccff"
android:gravity="center" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageSurveyClose"
android:layout_centerHorizontal="true"
android:paddingTop="40dp"
android:fontFamily="sans-serif"
android:gravity="center"
android:text="Question"
android:textColor="#ffffff"
android:textSize="22dp" />
<ImageButton
android:id="@+id/imageSurveyClose"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/close"
android:background="@null" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="Send" />
<RadioGroup
android:id="@+id/radioGroup2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:paddingTop="20dp"
android:layout_marginLeft="20dp"
>
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="v1"
android:layout_gravity="left"
android:fontFamily="sans-serif"
android:textSize="22dp"
android:buttonTint="#ffffff"
android:textColor="#ffffff"
android:layout_marginTop="10dp"
/>
<RadioButton
android:id="@+id/radio1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:fontFamily="sans-serif"
android:text="v2"
android:buttonTint="#ffffff"
android:layout_marginTop="12dp"
android:textColor="#ffffff"
android:textSize="22dp" />
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:buttonTint="#ffffff"
android:layout_height="wrap_content"
android:text="v3"
android:layout_gravity="left"
android:fontFamily="sans-serif"
android:layout_marginTop="12dp"
android:textSize="22dp"
android:textColor="#ffffff"
/>
</RadioGroup>
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/radioGroup2"
android:layout_below="@+id/radioGroup2"
android:layout_marginTop="47dp"
android:ems="10" >
<requestFocus />
</EditText>
</RelativeLayout>
【问题讨论】:
-
是不是换了主题才坏?
-
@Brian,我先把主题改成了 Material,所以我不知道...
-
@DimaKozhevin,我不想隐藏它,它不显示...所以问题是显示它
-
@DimaKozhevin 没有帮助,我知道我在设置或清单方面有问题,但不知道怎么回事
标签: android android-edittext android-softkeyboard