Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating a Bookshelf view in Android
    primarykey
    data
    text
    <p>I have seen many e-book readers with the Bookshelf design where books are placed like iBooks for Apple or iReader for Android. I am trying to build a similar bookshelf UI in Android. I have prepared the graphics for the layout namely shelf_left (34*180), shelf_right (34*180) and shelf_center (652*180). Currently I am targetting 720*1280 pixel density devices, so I have kept the total width as 720px. I am using dp as my length unit.</p> <p>I am using RelativeLayout as my root layout. When I am putting all my images in the layout, the images are not getting aligned properly. The shelf_center gets extra top and bottom padding and the side images looks too big. </p> <p>I am not able to figure out how to control this behavior. Below is the code for my main.xml layout.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="match_parent" &gt; &lt;ImageView android:id="@+id/shelf_left" android:layout_width="34dp" android:layout_height="180dp" android:adjustViewBounds="true" android:contentDescription="@string/button" android:src="@drawable/shelf_left" /&gt; &lt;ImageView android:id="@+id/shelf_center" android:layout_width="652dp" android:layout_height="180dp" android:layout_toLeftOf="@+id/shelf_right" android:layout_toRightOf="@+id/shelf_left" android:adjustViewBounds="true" android:contentDescription="@string/button" android:src="@drawable/shelf_center" /&gt; &lt;ImageView android:id="@+id/shelf_right" android:layout_width="34dp" android:layout_height="180dp" android:layout_alignParentRight="true" android:adjustViewBounds="true" android:contentDescription="@string/button" android:src="@drawable/shelf_right" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>This is how it looks:</p> <p><a href="http://img210.imageshack.us/img210/2885/shelf.png" rel="nofollow">http://img210.imageshack.us/img210/2885/shelf.png</a> </p> <p>Please help me figure out what am I doing wrong here. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload