Как выровнять виджет по правому краю в горизонтальной линейной компоновке Android?

Это код, который я использую, но он не работает:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    android:orientation="horizontal">

    <TextView android:text="TextView" android:id="@+id/textView1"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:gravity="right">
    </TextView>

</LinearLayout>
187
задан Cœur 15 November 2019 в 04:09
поделиться