Android 如何在没有translateY的情况下手动移动ImageView

Android 如何在没有translateY的情况下手动移动ImageView,android,android-layout,android-imageview,android-framelayout,Android,Android Layout,Android Imageview,Android Framelayout,我已经开始了一个布局,它应该是这样的: 但是我很难将3图像视图(红色)移动到准确的位置。这是我所能做到的: 现在我的问题是,我想将三个ImageView设置为clickable,以路由到它们相应的屏幕,但这不能应用到我的布局中,因为我只使用translateY将ImageView(蓝色)向下移动了60dp。真正的ImageView(蓝色)位置比ImageView(aqua)的实际显示高60 dp。所以点击它不会影响任何事情。 以下是我的xml: <RelativeLayout xmln

我已经开始了一个布局,它应该是这样的:

但是我很难将3图像视图(红色)移动到准确的位置。这是我所能做到的:

现在我的问题是,我想将三个ImageView设置为clickable,以路由到它们相应的屏幕,但这不能应用到我的布局中,因为我只使用translateY将ImageView(蓝色)向下移动了60dp。真正的ImageView(蓝色)位置比ImageView(aqua)的实际显示高60 dp。所以点击它不会影响任何事情。 以下是我的xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mypage_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/silver" >

<FrameLayout
    android:id="@+id/frame"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <ImageView
        android:id="@+id/table_1"
        android:layout_width="match_parent"
        android:layout_height="180dp"
        android:adjustViewBounds="true"
        android:background="@color/green" />

    <ImageView
        android:id="@+id/btn_top_page"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:adjustViewBounds="true"
        android:background="@color/maroon"
        android:clickable="true" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <RelativeLayout
            android:id="@+id/relative_left"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_toLeftOf="@+id/relative_center" >

            <ImageView
                android:id="@+id/btn_left"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:clickable="true"
                android:src="@color/aqua"
                android:translationY="60dp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/btn_left"
                android:layout_centerHorizontal="true"
                android:text="Left"
                android:textColor="#FFFFFF"
                android:translationY="65dp" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/relative_center"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_centerHorizontal="true"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp" >

            <ImageView
                android:id="@+id/btn_center"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:clickable="true"
                android:src="@color/fuchsia"
                android:translationY="70dp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/btn_center"
                android:layout_centerHorizontal="true"
                android:text="Center"
                android:textColor="#FFFFFF"
                android:translationY="75dp" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/relative_right"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_toRightOf="@id/relative_center" >

            <ImageView
                android:id="@+id/btn_right"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:clickable="true"
                android:src="@color/gray"
                android:translationY="60dp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/btn_right"
                android:layout_centerHorizontal="true"
                android:text="Right"
                android:textColor="#FFFFFF"
                android:translationY="65dp" />
        </RelativeLayout>
    </RelativeLayout>
</FrameLayout>

这是代码应该做的吗?
任何帮助都可以。非常感谢。

尝试使用layout\u marginTop而不是translationY

好的,这个对我来说很好,translateY也很好,我只是没有很好地测试它,我只是基于Eclipse的图形布局。谢谢你的回答。