Android Linear Layout - How to Keep Element At Bottom Of View?

前端 未结 8 1490
悲哀的现实
悲哀的现实 2020-12-08 01:50

I have a TextView which I want to pin at the bottom of a landscape activity that is using LinearLayout with vertically arranged elements.

相关标签:
8条回答
  • 2020-12-08 02:25

    You can also use

    android:layout_gravity="bottom"
    

    for your textview

    0 讨论(0)
  • 2020-12-08 02:28

    DO LIKE THIS

     <LinearLayout
    android:id="@+id/LinearLayouts02"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:gravity="bottom|end">
    
    <TextView
        android:id="@+id/texts1"
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:layout_weight="2"
        android:text="@string/forgotpass"
        android:padding="7dp"
        android:gravity="bottom|center_horizontal"
        android:paddingLeft="10dp"
        android:layout_marginBottom="30dp"
        android:bottomLeftRadius="10dp"
        android:bottomRightRadius="50dp"
        android:fontFamily="sans-serif-condensed"
        android:textColor="@color/colorAccent"
        android:textStyle="bold"
        android:textSize="16sp"
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp"
       />
    
    </LinearLayout>
    
    0 讨论(0)
提交回复
热议问题