gpt4 book ai didi

android - 如何获得重叠的图库项目?

转载 作者:行者123 更新时间:2023-11-30 04:29:54 24 4
gpt4 key购买 nike

我有一个包含多个项目的画廊,我正在尝试对它们进行定位,以便您可以看到下一个项目的边缘。很像这样:

http://imgur.com/mtQvX

任何关于我将如何进行定位的帮助?

最佳答案

这在某种程度上取决于你想用它走多远。应该可以使用一个简单的 ScrollView 来添加一个自定义 View ,该 View 包含您链接的图片中的所有组件。

您的自定义布局可能如下所示:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="340dp"
android:layout_height="fill_parent"
android:orientation="horizontal" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="24dp"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="29"
android:textColor="#ffff0000"
android:textSize="24dp"
android:textStyle="bold" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="of 30"
android:textSize="14dp"
android:textStyle="italic" />
</LinearLayout>

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="August 24 8:01 AM"
android:textStyle="italic" />

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Bruce Pearl&apos;s Show-Cause Pentalty And What It Means For His Coaching Future"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>

这看起来像

enter image description here

除此之外,如果你想做一些事情,比如让它捕捉到你的自定义 View 的边缘,或者类似的东西,那么你可能想看看 herehere .

关于android - 如何获得重叠的图库项目?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7908862/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com