代码之家  ›  专栏  ›  技术社区  ›  Student

小窗口中的WebView

  •  3
  • Student  · 技术社区  · 16 年前

    是否可以使WebView停留在一个小窗口中,而不是全屏显示?

    2 回复  |  直到 16 年前
        1
  •  0
  •   Community Mohan Dere    9 年前

    当然。。。例如,这将使 WebView 出现在 ListView :

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent"
    >    
      <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:layout_weight="1"
      />
      <WebView
        android:id="@+id/browser"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"
        android:layout_weight="1"
      />
    </LinearLayout>
    

    取自 Mark Murphy example . 顺便说一下,马克·墨菲是 常见的 guy 几秒钟前谁回答了这个问题。

        2
  •  1
  •   CommonsWare    16 年前

    一 WebView 是一个小部件,和其他的一样。您可以通过放置它的布局来控制它的大小。