3

Here I develop one Android application which has Bookshelf screen. But when I tested it on HTC-Salsa and SonyXperia-Sola I found major difference and ugly looking in SonyXperia-Sola.

HTC Mobile Screen is following.

enter image description here

Sony Mobile Screen is following.

enter image description here

Here I use custom gridview to display books, I fill this gridview with BaseAdapter and I set xml layout for gidviewitem, in gridview item xml layout I fix the book size, width = 150dp and height = 170dp.

4

2 回答 2

0

Use embedded horizontal LinearLayouts instead and give each book item the same layout_weight. Like.

<LinearLayout
    android:id="@+id/bookshelf_row1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal">
    <ImageView
        android:id="@+id/first_book"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/book_image"
        android:layout_weight="5" />
    <ImageView
        android:id="@+id/second_book"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/book_image"
        android:layout_weight="5" />
    <ImageView
        android:id="@+id/third_book"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:src="@drawable/book_image"
        android:layout_weight="5" />
</LinearLayout>
于 2012-09-19T10:25:18.197 回答
0

I converted the pixel value to dp according to density, and now it works.

于 2012-09-19T10:38:29.403 回答