I have a desire for a single-pixel dividing line, just for looks. I thought I could accomplish this using a 1px height view with a specific background. However, I get very strange behavior on different devices - sometimes 1px ends up as 2px.
Take this sample circuit, for example:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
<View android:layout_width="fill_parent" android:layout_height="1px"
android:background="@android:color/white" android:layout_marginBottom="4dp" />
</LinearLayout>
When you start my G1, it turns out fine . But on the Nexus One, it alternates between 1px lines and 2px lines .
Does anyone know where this is happening? Why does Android sometimes do 1px to 2px?
: , , , , ; , , " 1px ", , .