开发者

Custom Layout on the WebView

I want to Set the Custom layout on the WebView. .. I have Done with the LinearLayout and the RelativeLayout but i cant 开发者_如何转开发seen the Layout on the WebView How it is Possible to do ? Please help me. . . Thanks.


Keep a parent layout(Say Relative Layout) and set your layout there and within it set a linear layout according to your need and add webview within it. See the following code

<?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>

Hope this is what you want....

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜