【发布时间】:2019-03-29 16:04:10
【问题描述】:
我必须将第二个 TextView 和 ImageView 放在右侧,但重力不会移动。我能怎么做?也许“重力”不合适? 谢谢!
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:src="@drawable/JuventusLogo"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="JUVENTUS"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="REAL MADRID"/>
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_gravity="right"
android:src="@drawable/RealMadridLogo"/>
</LinearLayout>
【问题讨论】:
-
输出应该是什么样子?
标签: android xml layout-gravity