Guest Posted February 10, 2011 Share Posted February 10, 2011 Bonjour à tous! Je viens vers vous pour un petit coup de main concernant une interface graphique sur laquelle je me casse les dents depuis quelques jours. (Voir pièce jointe ) En gros, toute mon interface s'articule autour d'un ViewFlipper. Au dessus : un LinearLayout En dessous: un LinearLayout A gauche: une ImageView (utilisée pour afficher la vue précédente dans le ViewFlipper) A droite: une ImageView (utilisée pour afficher la vue suivante dans le ViewFlipper) J'imagine qu'il faut utiliser un RelativeLayout pour faire ça, mais j'avoue que je suis loin d'être un expert en la matière :emo_im_foot_in_mouth: Y'aurait-il ici, une ame charitable pour m'aider à résoudre ce problème ? Link to comment Share on other sites More sharing options...
Sylvain G Posted February 10, 2011 Share Posted February 10, 2011 Howdy-ho, si j'étais toi j'utiliserais un LinearLayout vertical (android:orientation="vertical") pour faire les 3 lignes qui comprennent: 1.LinearLayout 2.RelativeLayout (un linearlayout horizontal) qui contient ImageView/ViewFlipper/ImageView 3.LinearLayout C'est ordonné et pas trop chargé. Link to comment Share on other sites More sharing options...
Guest Posted February 10, 2011 Share Posted February 10, 2011 Howdy-ho, si j'étais toi j'utiliserais un LinearLayout vertical (android:orientation="vertical") pour faire les 3 lignes qui comprennent: 1.LinearLayout 2.RelativeLayout (un linearlayout horizontal) qui contient ImageView/ViewFlipper/ImageView 3.LinearLayout C'est ordonné et pas trop chargé. Salut Sylvain, Merci pour ta réponse (très rapide ^^) Je suis assez d'accord avec toi sur cette organisation, mais le truc que j'ai du mal à voir, c'est comment je vais dire à mon RelativeLayout de prendre toute la place disponible entre les deux LinearLayout... Tu vois ce que je veux dire ? Link to comment Share on other sites More sharing options...
Guest Posted February 10, 2011 Share Posted February 10, 2011 Bon je viens de trouver... En fait c'est tout con! Même pas besoin d'un RelativeLayout. Il suffit d'utiliser les "android:layout_weight" Voici le code : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center" android:background="#FFF" android:text="TEXTE" android:padding="10dp"/> </LinearLayout> <LinearLayout android:id="@+id/bottom_row" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_weight="1"> <ImageView android:id="@+id/view1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/arrow_left" /> <ViewFlipper android:id="@+id/details" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_weight="1"/> <ImageView android:id="@+id/view3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/arrow_right" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center" android:background="#FFF" android:text="TEXTE" android:padding="10dp"/> </LinearLayout> </LinearLayout> Merci quand même Sylvain Link to comment Share on other sites More sharing options...
Pierre87 Posted February 10, 2011 Share Posted February 10, 2011 "bottom_row" doit avoir android:layout_height à 0dip "details" doit avoir android:layout_width à 0dip c'est plus propre (garde tes weight à 1) Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2011 Share Posted February 11, 2011 "bottom_row" doit avoir android:layout_height à 0dip "details" doit avoir android:layout_width à 0dip c'est plus propre (garde tes weight à 1) OK! Merci ;) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.