我怎样才能在android studio中实现这个计划?

时间:2015-08-02 10:29:57

标签: android

我为自定义列表视图编写了这个xml文件:

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

    <ImageView
        android:id="@+id/imageView1"
        android:layout_gravity="center"
        android:layout_width="88dp"
        android:layout_height="88dp"
        android:src="@drawable/abc_btn_check_material" />

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

</LinearLayout>

我的输出是这样的:

enter image description here

我想将输出更改为:

enter image description here

我该怎么做?感谢。

2 个答案:

答案 0 :(得分:1)

尝试将其更改为:

  

机器人:layout_width = “match_parent”

然后使用:

  

机器人:layout_gravity = “右”

答案 1 :(得分:0)

您可以使用

    android:layout_gravity="right"