安卓新手求助,这个导航拦样式怎么实现?

发布于 2022-09-11 22:36:51 字数 3164 浏览 32 评论 0

图片描述

咸鱼这个导航拦样式怎么实现?就是左右留有空隙,然后每一个图下面有问题,我现在只能实现如下的样式,请问怎么修改?

图片描述

<LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="#2A01F6"
                android:gravity="center"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/imgSun1"
                    android:layout_width="45dp"
                    android:layout_height="46dp"
                    android:src="@mipmap/curry" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="#2A01F6"
                android:gravity="center"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/imgMoon2"
                    android:layout_width="30dp"
                    android:layout_height="47dp"
                    android:src="@mipmap/fried_rice" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="#2A01F6"
                android:gravity="center"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/imgStar5"
                    android:layout_width="38dp"
                    android:layout_height="50dp"
                    android:src="@mipmap/green_curry" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="#2A01F6"
                android:gravity="center"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/imgStar6"
                    android:layout_width="38dp"
                    android:layout_height="50dp"
                    android:src="@mipmap/green_curry" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="#2A01F6"
                android:gravity="center"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/imgStar8"
                    android:layout_width="38dp"
                    android:layout_height="50dp"
                    android:src="@mipmap/green_curry" />
            </LinearLayout>

        </LinearLayout>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

荒岛晴空 2022-09-18 22:36:51

recyclerView

星光不落少年眉 2022-09-18 22:36:51

通过Android自带的monitor工具,可以导出App的层级结构

「闲鱼」这个是用RelativeLayout实现的

另外,首页的顶部二级导航可以使用GridLayoutRecyclerView等来实现

情深缘浅 2022-09-18 22:36:51

RecyclerView
设置 LayoutManager,ItemDecoration

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文