HerrMueller Posted July 8, 2011 Share Posted July 8, 2011 Bonjour tout le monde. J'ai un petit problème dans un de mes fichiers XML. Il est structuré de la sorte : un RelativeLayout (avec divers TextView et EditText) englobé par un ScrollView. J'ai deux boutons à la fin pour soit confirmer ou annuler (je les ai mis dans un LinearLayout pour utiliser layout_weight). J'aimerais que, sur les résolutions d'écran n'utilisant pas le ScrollView, ces deux boutons soient situés tout en bas de l'écran. Voici un extrait de mon code : <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > //divers TextView et EditText <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/etRemarqueGar" android:paddingTop="15dp" android:layout_alignParentBottom="true" > <Button android:text="Confirmer" android:id="@+id/btConfirmerGar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:layout_alignParentBottom="true" ></Button> <Button android:id="@+id/btAnnulerGar" android:text="Annuler" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" /> </LinearLayout> </RelativeLayout> </ScrollView> Votre aide serait la bienvenue :emo_im_angel: Si quelque chose n'est pas clair, n'hésitez pas à me demander des renseignements supplémentaires. Link to comment Share on other sites More sharing options...
Lord Yu Posted July 8, 2011 Share Posted July 8, 2011 Si tu met ton ScrollView et RelativeLayout en layout_height="fill_parent", ça ne fonctionne pas ? Link to comment Share on other sites More sharing options...
HerrMueller Posted July 8, 2011 Author Share Posted July 8, 2011 Merci de ta réponse mais non, ça ne marche pas... Link to comment Share on other sites More sharing options...
BapNesS Posted July 8, 2011 Share Posted July 8, 2011 Peut-être que cela devrait t'aider : http://developer.android.com/resources/articles/layout-tricks-merge.html Link to comment Share on other sites More sharing options...
TecKnologikS Posted July 9, 2011 Share Posted July 9, 2011 faut rajouter le positionnement. perso j'ai fait Un Frame Layout ----> LinearLayout ----> ScrollView ---->LinearLayout -----> Linear layout Et apres tu joue avec layout gravity. Link to comment Share on other sites More sharing options...
HerrMueller Posted July 13, 2011 Author Share Posted July 13, 2011 Rebonjour, désolé pour la réponse tardive (j'étais en vacances! :) ) et merci pour les réponses! Il suffisait en effet d'englober le tout dans un FrameLayout et d'ajouter le paramètre android:gravity="bottom" au LinearLayout contenant les deux boutons. J'avais oublié l'existence de FrameLayout et son utilité... Merci pour les réponses qui ne se sont pas faites attendre! :) Link to comment Share on other sites More sharing options...
TecKnologikS Posted July 13, 2011 Share Posted July 13, 2011 J'utilise quasiment que ca... amuse toi bien ! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.