JingDe_Qin 2016-10-31 05:50 采纳率: 0%
浏览 731

我看别人的FramentTabhost渲染失败

<?xml version="1.0" encoding="utf-8"?>
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="zhulei.com.tabhostdemo.MainActivity">
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="@dimen/tab_height">
        </FrameLayout>

</android.support.v4.app.FragmentTabHost>

<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="@dimen/tab_height"
    android:layout_alignParentBottom="true">
    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/divider_height"
        android:background="@color/tab_bar_border"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal">
        <RelativeLayout
            android:id="@+id/tab_home"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">
            <ImageView
                android:id="@+id/tab_home_image"
                android:layout_width="wrap_content"
                android:layout_height="32dp"
                android:layout_centerHorizontal="true"
                android:src="@drawable/tabbar_home_highlighted"/>

            <TextView
                android:id="@+id/tab_home_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tab_home_image"
                android:layout_centerHorizontal="true"
                android:gravity="center"
                android:text="@string/tab_main"
                android:textSize="@dimen/font_tab_bar"
                android:textColor="@color/font_tab_bar_selected"/>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/tab_message"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">
            <ImageView
                android:id="@+id/tab_message_image"
                android:layout_width="wrap_content"
                android:layout_height="32dp"
                android:layout_centerHorizontal="true"
                android:src="@drawable/tabbar_message_center"/>

            <TextView
                android:id="@+id/tab_message_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tab_message_image"
                android:layout_centerHorizontal="true"
                android:gravity="center"
                android:textSize="@dimen/font_tab_bar"
                android:text="@string/tab_search"
                android:textColor="@color/font_tab_bar_unselected"/>
        </RelativeLayout>

        <ImageView
            android:id="@+id/compose_btn"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:layout_marginTop="3dp"
            android:layout_marginBottom="3dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:scaleType="centerInside"
            android:src="@drawable/bg_tab_add"/>

        <RelativeLayout
            android:id="@+id/tab_search"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">
            <ImageView
                android:id="@+id/tab_search_image"
                android:layout_width="wrap_content"
                android:layout_height="32dp"
                android:layout_centerHorizontal="true"
                android:src="@drawable/tabbar_search"/>

            <TextView
                android:id="@+id/tab_search_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tab_search_image"
                android:layout_centerHorizontal="true"
                android:gravity="center"
                android:textSize="@dimen/font_tab_bar"
                android:text="@string/tab_search"
                android:textColor="@color/font_tab_bar_unselected"/>
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/tab_profile"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">
            <ImageView
                android:id="@+id/tab_profile_image"
                android:layout_width="wrap_content"
                android:layout_height="32dp"
                android:layout_centerHorizontal="true"
                android:src="@drawable/tabbar_profile"/>

            <TextView
                android:id="@+id/tab_profile_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tab_profile_image"
                android:layout_centerHorizontal="true"
                android:gravity="center"
                android:textSize="@dimen/font_tab_bar"
                android:text="@string/tab_profile"
                android:textColor="@color/font_tab_bar_unselected"/>
        </RelativeLayout>
    </LinearLayout>
</FrameLayout>

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程