当前位置: 代码迷 >> Android >> android 中怎样能让tabhost竖起来啊该怎么解决
  详细解决方案

android 中怎样能让tabhost竖起来啊该怎么解决

热度:20   发布时间:2016-05-01 21:42:35.0
android 中怎样能让tabhost竖起来啊
比如:
table1 table2 table3
----------------------------------

要改成:

table1 |
  |  
table2 |
  |
table3 |  
  |
  |
  |



------解决方案--------------------
在TabActivity派生类的onPostCreate里面把content view改成自己的,本来是这样的布局:
XML code
<TabHost    xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@android:id/tabhost"    android:layout_width="match_parent"    android:layout_height="match_parent">    <LinearLayout        android:orientation="vertical"        android:layout_width="match_parent"        android:layout_height="match_parent">        <TabWidget            android:id="@android:id/tabs"            android:orientation="horizontal"            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:layout_weight="0"/>        <FrameLayout            android:id="@android:id/tabcontent"            android:layout_width="match_parent"            android:layout_height="0dip"            android:layout_weight="1"/>    </LinearLayout></TabHost>
  相关解决方案