Can't get precise layout on Nexus One

Posted by Johnny on Stack Overflow See other posts from Stack Overflow or by Johnny
Published on 2010-04-27T10:09:24Z Indexed on 2010/04/27 10:13 UTC
Read the original article Hit count: 232

Filed under:

I want to use precise layout on Nexus One, my code is like this:

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="90px">

    <ImageView
        android:layout_width="5px"
        android:layout_height="fill_parent"
        android:src="@drawable/d10" />

    <ImageView
        android:layout_width="94px"
        android:layout_height="fill_parent"
        android:src="@drawable/d5" />

    <ImageView
        android:layout_width="94px"
        android:layout_height="fill_parent"
        android:src="@drawable/d6" />

    <ImageView
        android:layout_width="94px"
        android:layout_height="fill_parent"
        android:src="@drawable/d7" />

    <ImageView
        android:layout_width="94px"
        android:layout_height="fill_parent"
        android:src="@drawable/d8" />

    <ImageView
        android:layout_width="94px"
        android:layout_height="fill_parent"
        android:src="@drawable/d9" />

    <ImageView
        android:layout_width="5px"
        android:layout_height="fill_parent"
        android:src="@drawable/d10" />

But it turns out on Nexus One, the screen width is not 480 px. So this LinearLayout will exceed the screen width.

How should I fix this?

© Stack Overflow or respective owner

Related posts about android