Tag: android input method

当使用带有EditText的AlertDialog.Builder时,软键盘不会popup

我正在使用AlertDialog.Builder创build一个input框,以EditText作为input法。 不幸的是,软键盘不会popup,虽然EditText是焦点,除非你明确地再次触摸它。 有没有办法强制它popup? (AlertDialog.Builder).show(); 但无济于事。 InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); mgr.showSoftInput(input, InputMethodManager.SHOW_FORCED); 任何人都可以帮忙 谢谢!!

android:windowSoftInputMode =“adjustResize”没有任何区别?

我有一个使用这个布局的人造对话框: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/containerPageConatiner"> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> </FrameLayout> 我根据正在打开的对话框在<FrameLayout>放置一个片段 – 控制Dialog的活动如下所示: <activity android:label="@string/app_name" android:name=".activity.DialogActivity" android:theme="@style/CustomTheme.Screen.Transparent" android:windowSoftInputMode="adjustResize"> 不幸的是,当你点击对话框中的编辑文本时,不会发生大小调整。 windowSoftInputMode从字面上看没有区别,因为function与平移模式相同。 文档说:“这当然只适用于具有可调整空间的可调整区域的应用程序”,但并没有告诉你“可resize的区域”是什么意思,使我觉得在某种程度上,有一个可调整的区域? 如果有人知道什么可以帮助我吗? 编辑 围绕这样的对话不会改变任何事情: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/containerPageConatiner" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <View android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="1" /> <FrameLayout android:id="@+id/dialogHolder" android:layout_height="wrap_content" android:layout_width="wrap_content" android:padding="15dp" android:layout_gravity="center" android:background="@drawable/panel_picture_frame_bg_focus_blue"/> <View android:layout_width="0dp" […]

禁用横向软键盘input的全屏编辑视图?

在使用软键盘的Android设备上,我想防止在横向模式下(即,我只想看到软键盘本身和我的视图)出现全屏键盘编辑视图(如下所示)。 我认为这可以使用InputMethodService上的setExtractViewShown(false)方法来实现,但是我无法访问这个默认实例,也不想实现一个自定义的input方法。 编辑添加:input的视图不是TextView (它是一个具有自定义InputConnection实现的View ),所以android:imeOptions="flagNoExtractUi"在这里不起作用。

closures/隐藏Android软键盘

我在我的布局中有一个EditText和一个Button 。 在编辑字段中写入并单击Button ,我想要隐藏虚拟键盘。 我假设有一个简单的一行或两行代码来实现这一点。 我在哪里可以find它的一个例子?