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>

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

  • 相关阅读:
    HTML area coords 属性
    在Java中,替换字符串String中特定索引处的字符char?
    JavaScript 之 history对象
    JavaScript 之 location 对象
    JavaScript 之 定时器
    JavaScript 之 页面加载事件
    JavaScript 之 对话框
    JavaScript 之 BOM
    Java 之 可变参数
    Java 之 LinkedHashSet 集合
  • 原文地址:https://www.cnblogs.com/caoxinyu/p/6647850.html
Copyright © 2011-2022 走看看