开发者

Webview in a small window

Is it possible to make the webview stay as a small window, instead of get the full screen开发者_Go百科?


A WebView is a widget like any other. You control its size via the layout you put it in.


Of course... for example this will make a WebView appear next to a 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>

Taken from a Mark Murphy example. By the way, Mark Murphy is the commonguy who answer this question some seconds ago.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜