【发布时间】:2011-04-19 07:40:28
【问题描述】:
我想在 WebView 上设置自定义布局。 .. 我已经完成了 LinearLayout 和 RelativeLayout 但我看不到 WebView 上的布局 怎么可能?请帮我。 . . 谢谢。
【问题讨论】:
标签: android android-layout android-widget android-manifest
我想在 WebView 上设置自定义布局。 .. 我已经完成了 LinearLayout 和 RelativeLayout 但我看不到 WebView 上的布局 怎么可能?请帮我。 . . 谢谢。
【问题讨论】:
标签: android android-layout android-widget android-manifest
保留一个父布局(说相对布局)并在那里设置您的布局,并根据您的需要在其中设置一个线性布局,并在其中添加 webview。 见以下代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@+id/ImageView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/main_title_bg"
></ImageView>
<TextView
android:id="@+id/TitleText"
android:layout_height="wrap_content"
android:text="About us"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dip"
android:textSize="18dip"
android:textColor="#ffffff"
></TextView>
<LinearLayout
android:id="@+id/linearlayout01"
android:layout_below="@id/ImageView01"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
</RelativeLayout>
希望这是你想要的......
【讨论】: