【发布时间】:2011-10-08 19:13:09
【问题描述】:
我遇到了以下问题,我制作了一个带有画廊的表单,画廊而不是包含图像的包含来自我的一个班级的项目,画廊的每个项目内的所有内容都完美显示。我使用以下方法删除了图像之间的空间:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Gallery android:id="@+id/galleryid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:spacing="0dip"
android:padding="0dip"
android:layout_weight="1" />
画廊的项目:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="75dip" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:orientation="vertical" android:gravity="center_horizontal" android:background="#ffffff">
<TextView android:id="@+id/frame_number" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="-" android:textSize="12dip" android:textColor="#ffffff" android:background="#000000" android:gravity="center" />
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="horizontal" android:gravity="center_horizontal">
<TextView android:id="@+id/frame_shot1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="-" android:textSize="18dip" android:textColor="#000000" />
<TextView android:id="@+id/frame_shot2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="-" android:textSize="18dip" android:textColor="#000000" />
</LinearLayout>
<TextView android:id="@+id/frame_total" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="---" android:textSize="38dip" android:textColor="#000000"/>
</LinearLayout>
buuuuuuuuuuuuuuuuut ,我遇到了一个问题,画廊的开头和结尾有一些空白区域,没有任何项目。问题是我的画廊上有很多项目,你实际上可以水平滚动,但我想摆脱这些空间,所以画廊最左边的第一件事是第一个项目,当你滚动时最后一个项目最右边是正确的项目。
编辑 08/16 在项目中仍然存在同样的问题,在这里我留下了一张我想要摆脱的图像,那就是开始时的黑色空间(也在结尾另一边的画廊)
【问题讨论】:
-
您找到解决方案了吗?
-
你好 Mina 和 Ale k 你找到这个问题的解决方案了吗?
-
您好 SRam、Mina 和 Ale K,您找到上述问题的解决方案了吗?
标签: android gallery horizontal-scrolling