Webview上的一部分应用程序

时间:2011-03-06 12:26:07

标签: android webview

在我的应用程序中,我想在应用程序的视图中显示一个网页。

我不确定如何仅在应用程序的一部分上应用视图并在视图中打开网页。

当用户点击按钮时,视图中的网页将会打开。

网页视图将位于屏幕的右侧,如下图所示:

enter image description here

这可能吗?

请帮忙。感谢

编辑:

我在已经拥有的相对布局中包含了一个tablelayout。

<TableLayout android:layout_width="200dip"
        android:layout_height="100dip" android:stretchColumns="1"
        android:background="#000000" xmlns:android="http://schemas.android.com/apk/res/android"
         android:layout_marginLeft="250px"
         android:layout_marginTop="80px">
<TableRow>
<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
/>
</TableRow>
</TableLayout>  

然后我在一个onclick按钮中调用我的应用程序中的webview:

mWebView = (WebView) findViewById(R.id.webview);
            mWebView.getSettings().setJavaScriptEnabled(true);
            mWebView.loadUrl("http://www.google.com");

但是当我点击它时没有任何反应?

1 个答案:

答案 0 :(得分:0)

尝试:http://developer.android.com/reference/android/widget/TableLayout.html

将其中一个单元格设置为Web视图。

相关问题