2012-02-22 6 views
0

タブ内にwebViewが必要ですが、簡単な作業でなければなりませんが、投稿を読んで、提案をテストする時間があり、解決策を見つけることができません。タブは一番下の部分にあります。私はレイアウトを変更し、特定のアクティビティを作成しました。その後、ウェブビューはまだ全画面にフィット!私は必要に応じてコードを掲示するためにぎれるでしょう!タブ内のアンドロイドウェブビューは常にフルスクリーンに収まります

+0

プログラムで追加する場合は、webviewまたはコードのレイアウトコードを投稿してください。 –

答えて

3

この

Webview Xml.................. 

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" android:layout_height="match_parent" 
    android:background="@drawable/ab02_bg" > 


      <WebView android:autoLink="web" android:layout_width="wrap_content" 
       android:layout_height="wrap_content" android:src="@drawable/ticket_text" 
       android:id="@+id/TextViewMorTickets" android:textColor="@android:color/black"></WebView> 

タブのXml ....................

<?xml version="1.0" encoding="utf-8"?> 
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@android:id/tabhost" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/ab02_bg" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" > 
     <ImageView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:src="@drawable/hddr" > 
     </ImageView> 
     <FrameLayout 
      android:id="@android:id/tabcontent" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" > 
     </FrameLayout> 
     <ImageView 
      android:layout_width="fill_parent" 
      android:layout_height="30dip" 

      android:baselineAlignBottom="true" 
      android:id="@+id/BannerImage" 
      > 
     </ImageView> 
     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="fill_parent"      
      android:layout_height="wrap_content" 
      android:layout_weight="0" 
      android:tabStripEnabled="false" 
    /> 
    </LinearLayout> 

</TabHost> 
</LinearLayout> 

javaファイルを試してみてください...... .....................

@Override 
    protected void onCreate(Bundle savedInstanceState) { 
     // TODO Auto-generated method stub 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.tablayout); 
       tabHost = getTabHost(); // The activity TabHost 
     TabHost.TabSpec spec; 
       spec = tabHost.newTabSpec("TICKETS").setIndicator("").setContent(new Intent().setClass(this, webview.class)); 

     tabHost.addTab(spec); 
} 
+0

gr8 yar dipaliは完全に私が望むように働いています –

+0

+1すばらしい答えは、それは私を助けました本当に:P – mAc

+0

すごく、本当に役立ちます!この問題は私を夢中にさせていた!どうもありがとう! – Jaume

関連する問題