解决方案 »

  1.   

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ffffff"
            android:orientation="horizontal"
            android:paddingLeft="50px" >        <LinearLayout
                android:id="@+id/outer"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="horizontal" >            <TextView
                    android:layout_width="1dp"
                    android:layout_height="fill_parent"
                    android:background="#ff0000" />            <TextView
                    android:layout_width="1dp"
                    android:layout_height="fill_parent"
                    android:layout_marginLeft="5dp"
                    android:background="#00ff00" />            <TextView
                    android:layout_width="1dp"
                    android:layout_height="fill_parent"
                    android:layout_marginLeft="5dp"
                    android:background="#0000ff" />
            </LinearLayout>
        </LinearLayout>
      

  2.   

    android:layout_marginLeft="-1px",这时候应该是临界点,会三条都出来的
    android:layout_marginLeft="-2px",应该出两条
    android:layout_marginLeft="-3px",应该出一条
      

  3.   

    那marginLeft=0算什么
    0应该才是临界
      

  4.   

    间距太少了,你能不能改view,<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#ffffff"
        android:orientation="horizontal"
        android:paddingLeft="50px" >
     
        <LinearLayout android:id="@+id/outer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="-2px" >
     
            <View
                android:layout_width="1px"
                android:layout_height="match_parent"
                android:background="#ff0000" 
                android:layout_marginLeft="1dp"/>
     
            <View
                android:layout_width="1px"
                android:layout_height="match_parent"
                android:background="#00ff00"
                android:layout_marginLeft="0dp" />
     
            <View
                android:layout_width="1px"
                android:layout_height="match_parent"
                android:background="#0000ff" 
                android:layout_marginLeft="0dp"/>
        </LinearLayout>
     
    </LinearLayout>
      

  5.   

    我试了一下,在开发工具里看你的布局,的确是存在这个诡异的现象。但是真机跑起来后android:layout_marginLeft="-1px"也是只出现两条的,必须android:layout_marginLeft="0px",才出三条。应该是ADT让用户更容易看清楚吧
      

  6.   

    楼主的意思是觉得android:layout_marginLeft="-1px"这样仍然能出现三条很奇怪,按理说应该被盖住1个像素
      

  7.   

    https://code.google.com/p/android/issues/detail?id=60735
      

  8.   

    楼主的意思是觉得android:layout_marginLeft="-1px"这样仍然能出现三条很奇怪,按理说应该被盖住1个像素(⊙o⊙)哦,这样啊,,,