Affichage TextView Bas de l'Écran sous Android
Dans ma demande,
je veux afficher un TextView en Haut de l'Écran avec la largeur de l'écran. prochain voulez afficher la vue graphique ci-dessous que TextView. à côté de l'affichage un Affichage de Texte ci-dessous que la Vue Graphique.
J'ai utilisé le code xml suivant. Dans mon code TextView ne pourrais pas afficher en bas de l'écran de mesure.
<?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"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<TextView
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:background="#FF8A11"
android:padding="8dip"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<com.game.viewdot.ViewDot
android:id="@+id/DrawView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="bottom"
android:layout_gravity="bottom"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Another Text View"
android:background="#FF8A11"
android:padding="8dip"
android:gravity="bottom"
android:layout_gravity="bottom"
/>
</LinearLayout>
Quel modification je veux mettre dans ce code pour obtenir mon résultat??????
Pourquoi ne pas vous utiliser
RelativeLayout
? De nouveau modifier la mise en page de sorte qu'il peut visualisé correctementOriginalL'auteur ios developer | 2011-04-21
Vous devez vous connecter pour publier un commentaire.
Au lieu d'utiliser LinearLayout en tant que parent de mise en page utilisation Relative de Mise en page.
Essayez d'utiliser le code suivant
Espère que cela va vous aider...:)
Mais le fait d'être un développeur, je veux savoir ce que c'est possible de le faire à travers linéaires de mise en page ?
oui u peut faire de même en utilisant Linéaire mise en page aussi.
OriginalL'auteur Dinesh Sharma
essayer cette
OriginalL'auteur
ensemble de tous les linearlayout hauteur
OriginalL'auteur
jeu android:layout_height="fill_parent" propriété pour tous les Afficher attendre TextView....
si j'ai mis comme ceci signifie top TextView ne s'affiche.
u avait utilisé RelativeLayout? je suis sûr que cela fonctionnera très bien.. n plz modifier votre code correctement bcz du code n'est pas visible
maintenant, j'ai utilisé le code suivant
J'ai utilisé relative de la mise en page. maintenant mon top textView ne pourrais pas afficher. <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/bonjour" android:background="#FF8A11" android:padding="8dip" android:layout_alignParentTop="true" /> j'ai utilisé ci-dessus les choses de haut affichage de texte.
OriginalL'auteur Niranj Patel