ImageView 和 TextView 左右对齐怎么办?

How to align ImageView and TextView left side and right side?

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="end"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.ayush.ebook.MainActivity$PlaceholderFragment" >

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:src="@drawable/imb" />

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/imageView1"
    android:layout_alignParentRight="true"
    android:layout_alignTop="@+id/imageView1"
    android:layout_toRightOf="@+id/imageView1"
    android:background="@drawable/a"
    android:textAppearance="?android:attr/textAppearanceMedium" /></RelativeLayout>

这是我的布局。我在左侧有一个 ImageView,在右侧有一个 TextView。当我将 ScrollView 添加到其中时,LinearLayout 使它上下移动。我需要一个 ScrollView 以及对齐 ImageView 和 TextView 的方式。

帮帮我!

为左侧添加:

android:layout_alignParentLeft="true"

右边是这个:

android:layout_alignParentRight="true"

复制这个:

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:src="@drawable/imb"
    android:layout_alignParentLeft="true" />

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/imageView1"
    android:layout_alignParentRight="true"
    android:layout_alignTop="@+id/imageView1"
    android:layout_toRightOf="@+id/imageView1"
    android:background="@drawable/a"
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:layout_alignParentRight="true"/></RelativeLayout>