首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >2列3行精确拟合,相对布局(Android)

2列3行精确拟合,相对布局(Android)
EN

Stack Overflow用户
提问于 2017-01-06 10:28:38
回答 0查看 1K关注 0票数 1

我有六个ImageView块,我想放在一个垂直布局中,2列乘3行。

我如何让它们精确地匹配,以便我将有六个均匀分布的块。

最后四个区块之间略有重叠。

(ImageView 3-6与前两个基本相同。)

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">


<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:id="@+id/imageView"
    android:padding="96dp"
    android:background="@color/colorAccent" />

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/imageView"
    android:layout_alignParentRight="true"
    android:id="@+id/imageView2"
    android:background="@color/colorPrimary"
    android:padding="96dp" />

<ImageView
   3 />

<ImageView
   4  />

<ImageView
   5 />

<ImageView
   6  />

</RelativeLayout>
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41498003

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档