(技术)WebView 编辑器 如何主动获取焦点 弹出键盘
2020-03-12 本文已影响0人
点映文艺
直接上代码:
<include
android:focusable="true"
android:focusableInTouchMode="true"
layout="@layout/editor" />
看出门道没? 在WebView的根布局添加获取焦点的代码
如何主动弹出键盘? android:windowSoftInputMode="stateVisible|adjustResize"
editor 代码 >>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:orientation="vertical">
<com.tencent.smtt.sdk.WebView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/title"
android:layout_weight="1" />
</LinearLayout>