JeremX Posted February 6, 2011 Share Posted February 6, 2011 Bonjour, je débute dans la programmation sur Android, et j'ai un petit soucis, dès le début (ça commence bien!). J'ai suivi un tutoriel en français où il est juste question de modifier l'aspect et la position du texte. J'ai donc juste besoin de modifier le fichier main.xml... Je veux afficher mon texte au centre horizontalement et verticalement. Que je veuille le mettre en gras ou même changer la couleur de mon fond d'écran, ça ne marche pas, c'est comme si ces attributs n'étaient pas dans le fichier... Voici mon code: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center_vertical|center_horizontal" > <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center_vertical|center_horizontal" android:text="@string/hello" /> </LinearLayout> Est-ce que vous auriez une solution? Avec ce soucis, je n'ose même pas m'aventurer plus loin... :emo_im_foot_in_mouth: Merci d'avoir lu. :) Link to comment Share on other sites More sharing options...
JeremX Posted February 7, 2011 Author Share Posted February 7, 2011 UP Link to comment Share on other sites More sharing options...
Noplait Posted February 7, 2011 Share Posted February 7, 2011 Yop, Tu n'utilises pas la bonne option : android:layout_centerHorizontal="true" android:layout_centerVertical="true" Ca devrait fonctionner, si tu veux le faire manuellement tu sélectionnes ton textview et dans les propriétés à droite tu déroules la liste "Misc". Voilà Bonne journée Link to comment Share on other sites More sharing options...
JeremX Posted February 7, 2011 Author Share Posted February 7, 2011 Merci pour ta réponse Noplait, mais cela ne marche toujours pas. :emo_im_foot_in_mouth: Est-ce que tu veux le code source du fichier JAVA? Link to comment Share on other sites More sharing options...
JeremX Posted February 8, 2011 Author Share Posted February 8, 2011 UP. :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.