2011-05-25 40 views
0

我的屏幕底部有一個tabbar。 XML文件如下所示:帶有Tabbar的Webview下面

<TabHost android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@android:id/tabhost" 
    xmlns:android="http://schemas.android.com/apk/res/android" > 
    <RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@color/background"> 
    <TabWidget 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:id="@android:id/tabs" 
    android:layout_alignParentBottom="true" /> 
    <FrameLayout 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@android:id/tabcontent" > 

    </FrameLayout> 
    </RelativeLayout> 
</TabHost> 

在其中一個頁面上,我有一個webview。 XML文件:

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/background" 

    > 

    <RadioGroup 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:gravity="center_horizontal" 

     android:id="@+id/group1" 

    > 


<nl.smartcityguide.geurenkleuren.SegmentedControlButton android:checked="false" android:text="@string/string1" android:id="@+id/option1" /> 
<nl.smartcityguide.geurenkleuren.SegmentedControlButton android:checked="false" android:text="@string/string2" android:id="@+id/option2" /> 

</RadioGroup> 


<WebView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/webview1" 

> 
</WebView> 



</LinearLayout> 

問題是webview中的網頁太長,tabbar消失。我該如何解決這個問題?

親切的問候,

約阿希姆

+0

其中是你的xml文件........ ?? ?? – Sujit 2011-05-25 12:28:21

+0

您是否發現問題?我有同樣的問題,正在讓我瘋狂! – Jaume 2012-02-21 20:07:15

回答

0

我做你的代碼的修改。現在它按預期工作。

<?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:background="@color/background" 

    > 

<WebView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:id="@+id/webview1" 
    android:layout_alignParentBottom="true" 
> 
</WebView> 
    <RadioGroup 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:gravity="center_horizontal" 

     android:id="@+id/group1" 
     android:layout_above="@+id/webview1" 
    > 


<nl.smartcityguide.geurenkleuren.SegmentedControlButton android:checked="false" android:text="@string/string1" android:id="@+id/option1" /> 
<nl.smartcityguide.geurenkleuren.SegmentedControlButton android:checked="false" android:text="@string/string2" android:id="@+id/option2" /> 

</RadioGroup> 

不要忘記投票,如果我的迴應對你有幫助。

謝謝 Deepak

+0

與我同樣的問題,並建議解決方案無法正常工作。仍然適合全屏! – Jaume 2012-02-21 20:05:34