I’m workin on an Android app (comptabile with android 2.3 and higher) and I need to make a coverflow with two navigations arrows aligned at left and right of the coverflow
I tried many things, but can’t figure out to make the left arrow aligned at the left of the layout and the right arrow at the right of the layout.
I always have margins even if I havent specified padding or margin
Here is a screenshot : http://accessdev.s3.amazonaws.com/temp/layout_madness_android.jpg
I used a black background in order to show that the size is correct (100% of parent) but we can see that the arrows are not left/right aligned.
I checked and the problem is not inside the images itselves.
here is my layout code, help would be appreciated 🙂
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/BonsPlans_coverFlowAndArrows"
android:layout_width="match_parent"
android:layout_height="145px"
android:layout_gravity="left"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip"
android:background="#ff000000"
android:paddingLeft="0px"
android:paddingRight="0px"
>
<ImageView
android:id="@+id/bonsplans_fleche_gauche"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_marginLeft="0dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:src="@drawable/fleche_gauche" />
<ImageView
android:id="@+id/bonsplans_fleche_droite"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="0dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:layout_toRightOf="@drawable/fleche_gauche"
android:src="@drawable/fleche_droite" />
<pl.polidea.coverflow.CoverFlow
xmlns:coverflow="http://schemas.android.com/apk/res/com.accessdev.tellmeplus"
android:id="@+id/BonsPlans_coverflow"
android:layout_width="match_parent"
android:layout_height="145px"
android:layout_centerInParent="true"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip"
android:layout_marginTop="0dip"
android:layout_toLeftOf="@+id/bonsplans_fleche_droite"
android:layout_toRightOf="@+id/bonsplans_fleche_gauche"
coverflow:imageHeight="125px"
coverflow:imageWidth="150px" />
</RelativeLayout>
Can’t you use LinearLayout. Set fixed widths for left and right image e.g.
And for center one (it will resize itself)