【发布时间】:2014-01-24 03:41:15
【问题描述】:
我现在无法将一个 imageview 定位在另一个 imageview 下方。尽管我使用过 android:layout_below 似乎没有发生任何事情。我以前成功地做到了这一点。我现在唯一能想到的是这个 imageview 拥有并且图像相当大(宽度 500sp,高度 750sp)。
三个imageview的id如下-两个小view
1) 单人 2) 体积 3) extraImage(这是保存大图像的视图)
我想把 extraImage 放在单个下面
这里是xml语法
<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:paddingBottom="5dp"
android:paddingLeft="0px"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="0px"
android:background="#ffffff"
tools:context=".PhraseActivity" >
<ImageView
android:id="@+id/single"
android:layout_width="68sp"
android:layout_height="68sp"
android:layout_centerVertical="true"
/>
<ImageView
android:id="@+id/extraImage"
android:layout_width="500sp"
android:layout_height="750sp"
android:layout_below="@+id/single"
/>
<ImageView
android:id="@+id/volume"
android:layout_width="50sp"
android:layout_height="40sp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
/>
</RelativeLaoyout>
这就是我想要的方式
现在是这样的
所以我的问题是:我该如何解决这个问题 - 我如何将大图像视图定位在小图像视图下方(单个)?
我也尝试过 android:layout_toEndOf="" 没有成功
【问题讨论】:
-
你在使用相对布局吗??
-
@mohammedmomn 是的 - 所有的孩子都被包裹在一个相对布局中
-
请出示您的整个 xml 文件
-
@Aamirkhan - 我已经更新了我的代码 - 现在你可以看到完整版了
标签: android android-layout android-imageview