caoxinyu

今天做app底部的导航栏,就是会有一个分割线,分割内容和下面的fragmenttablehost,那条线,我看开源中国是用relativelayout包裹的。
我也包裹,但是不行。显示不出来那条线。
后来我意识到是顺序的问题,也就是fragmenttablehost在下面,就会把上面的view那一层覆盖掉,导致出现不了分隔栏。

总之:

 <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:background="@color/white"

        >


    <com.chinaCEB.cebActivity.widget.MyFragmentTabHost
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@android:id/tabhost"
        android:background="@color/white"
        android:layout_marginTop="5dp"
        >
    </com.chinaCEB.cebActivity.widget.MyFragmentTabHost>

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="#CCCCCC"


            >

        </View>
    </RelativeLayout>

 <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:background="@color/white"

        >
         <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:background="#CCCCCC"


            >

        </View>


    <com.chinaCEB.cebActivity.widget.MyFragmentTabHost
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@android:id/tabhost"
        android:background="@color/white"
        android:layout_marginTop="5dp"
        >
    </com.chinaCEB.cebActivity.widget.MyFragmentTabHost>


    </RelativeLayout>

显示效果不一样。学习的时候知道,开发的时候不注意真的不知道 。

分类:

技术点:

相关文章:

  • 2021-10-17
  • 2021-12-12
  • 2021-08-05
  • 2021-06-11
  • 2021-04-17
  • 2021-06-07
  • 2021-10-14
  • 2021-08-31
猜你喜欢
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2021-05-17
  • 2021-05-22
  • 2021-10-02
相关资源
相似解决方案