在Android中,在页脚处对齐3个水平图像
我在安卓上工作。我想在页脚水平对齐3个图像。 下面是我的代码。先谢谢你在Android中,在页脚处对齐3个水平图像,android,html,css,Android,Html,Css,我在安卓上工作。我想在页脚水平对齐3个图像。 下面是我的代码。先谢谢你 <RelativeLayout android:id="@+id/footer" android:layout_width="match_parent" android:layout_height="40dp" android:layout_alignParentBottom="true" android:background="#ccc"
<RelativeLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:background="#ccc"
android:gravity="center"
android:layout_padding="-30dp">
<ImageView
android:id="@+id/imgView6"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/plus"/>
<ImageView
android:id="@+id/imgView6"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/plus"/>
<ImageView
android:id="@+id/imgView6"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/plus"/>
</RelativeLayout>
假设您希望所有3个图像视图的大小相同?我会使用线性布局,方向为水平,每个图像视图的权重为1?其他人现在应该做什么?对你的imageview
做点什么,就像对第一张图片添加android:alignParentLeft=“true”
,对中心图片添加android:layouttoLeftof=“@id/fisrt_image”
,对最后一张图片添加这个android:layouttorightoof=“@id/second_image”
。请将图像的ID更改为不同的名称,因为您已为所有三张图像设置了相同的名称。@米兰·马哈拉詹,我无法将其水平对齐@user3294039,谢谢,将应用相同的@anirudha,您什么也不做,我认为您向其他人提出此类问题并不明智。如果你至少不知道答案,不要评论