10
votes

Afficher TextView bas de l'écran dans Android

dans ma demande, Je souhaite afficher un TextView en haut de l'écran avec la largeur de l'écran. Suivant veulent afficher une vue graphique ci-dessous sur TextView. Suivant Afficher une vue texte ci-dessous cette vue graphique.

J'ai utilisé après le code XML. Dans mon code TextView ne pouvait pas afficher en bas de la screen. xxx

Quelle modification je veux mettre dans ce code pour obtenir mon résultat ??? ???


1 commentaires

Pourquoi n'utilisez-vous pas relativenelayout ? À nouveau éditer la mise en page afin qu'elle puisse voir correctement


4 Réponses :


0
votes

Définir la hauteur linearlayout xxx


1 commentaires

Si je définis Remplir le parent sur TOUT la mise en page signifie Top TextView uniquement Affichage uniquement.



0
votes

SET Android: Layout_height = "Fill_Parent" Propriété pour toutes les afficher Attendez-vous à TextView ....


3 commentaires

Si je définis comme si cela signifie top TextView uniquement affiché.


U avait utilisé relativenelayout? Je suis sûr que ça fonctionnera bien .. n plz Modifier votre code correctement BCZ Certains code ne sont pas visibles


J'ai utilisé la mise en page relative. Maintenant, mon top TextView ne pourrait pas afficher. J'ai utilisé ci-dessus des choses pour la vue top textuelle.



8
votes

au lieu d'utiliser linearlayout en tant que mise en page parent, utilisez une mise en page relative. Essayez d'utiliser le code suivant

 <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/relative01"
        >
    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello"
        android:background="#FF8A11" 
        android:padding="8dip"
        android:id="@+id/textView01"
        />
        <LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/textView01"
    >
    <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:layout_alignParentBottom="true"
    >

    <TextView  

    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="Another Text View"
    android:background="#FF8A11"
    android:padding="8dip"

    />

    </LinearLayout>

    </RelativeLayout>


2 commentaires

Mais être un développeur, je veux savoir que est-il possible de le faire par la mise en page linéaire?


@Prateekbhardwaj Oui, vous pouvez faire la même chose en utilisant également la mise en page linéaire.



17
votes

Essayez ceci xxx


1 commentaires

Juste curieux, pourquoi avez-vous besoin android: layout_gravity = "bas" ?