Textview does not align below with the android property:layout_gravity="bottom"

Asked

Viewed 104 times

1

I have two Texts views that will appear in a Listview and I want one to be aligned above and one below, but it’s not working the way I’m doing.

inserir a descrição da imagem aqui

xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">


<ImageView
    android:id="@+id/imageView_lista_notify"
    android:layout_width="48dp"
    android:layout_height="48dp"
    android:layout_margin="4dp"
    android:src="@drawable/ic_menu_gallery" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<TextView
    android:id="@+id/texto_notificacao_list"
    android:layout_marginTop="4dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#000000"
    android:layout_gravity="top"
    android:text="TextView" />

<TextView
    android:id="@+id/texto_hora_list"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textColor="#000000"
    android:layout_gravity="bottom"
    android:text="TextView" />
</LinearLayout>
</LinearLayout>

  • Try switching from Linearlayour to Relativelayout

  • But I am using LINEAR layout in the other listview and the property Gravity is working, not that not , but vlw

  • Then try android:layout_alignParentBottom="true"

  • Look at this reply.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.