0

在我的布局 xml 文件中,我有 webview 和 LinearLayout。当我为 webview 打开 softinputmethod 时,webview editText 窗口(如谷歌)取决于键盘,这很好。但是当键盘打开时,我的线性布局是如此的挤压,以至于所有的按钮看起来都很可怕。

如何设置,那个键盘可以改变webview,但不能破坏RelativeLayout?

有一些代码:

   <RelativeLayout
        android:id="@+id/homebar"
        android:layout_width="50dp"

        android:layout_height="match_parent"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
         >
...//there is some buttons

</RelativeLayout>
     <WebView
        android:id="@+id/wv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"

        android:layout_toLeftOf="@+id/homebar" />

[对不起,我的英语不好]

4

1 回答 1

0

当动态视图预计在之后加载到活动中时,LinearLayout 不是处理视图的好方法。一定要使用相对布局来解决这个问题。

<RelativeLayout 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"
    tools:context=".MainActivity" >

</RelativeLayout>
于 2013-02-25T08:26:12.030 回答