zoukankan      html  css  js  c++  java
  • RelativeLayout 深入理解

    今天做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>

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

  • 相关阅读:
    Hbuilder实用快捷键
    ECMAScript中的箭头函数 (=>) 使用注意事项
    DreamWeaver CC 中的回车
    Django——正则表达式的举例与基本语法
    Django——如何处理请求(URL配置和视图)
    excel之导出
    eclipse几种常见问题的解决
    XML与JavaScript知识
    XML入门知识
    数据库实验7(pl/sql)
  • 原文地址:https://www.cnblogs.com/caoxinyu/p/6647850.html
Copyright © 2011-2022 走看看