如何在画廊中除去空间 [英] How to remove space in the gallery

查看:102
本文介绍了如何在画廊中除去空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个galleries.image画廊和一个文本画廊seperately.There是在开始的空间,无论是galleries.All的结束是相对layout.I不明白什么是problem.Please帮助。

I have two galleries.image gallery and a text gallery seperately.There is space at the beginning and end of both the galleries.All are in relative layout.I dont understand what is the problem.Please help.

我已经发布我的code也:

I have posted my code also:

     <?xml version="1.0" encoding="utf-8"?>
        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/main"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
            >

    <TextView android:text="Airing Now" 
    android:id="@+id/titletextview" 
    android:textSize="22dip"
    android:textColor="@color/textcolor"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content">
    </TextView>


    <Gallery
    android:id="@+id/Gallery_image" 
    android:layout_below="@+id/titletextview"
    android:spacing="15dip"
android:padding="15dip"

    android:layout_width="fill_parent" 
    android:layout_height="wrap_content">
    </Gallery>

    <ImageView android:id="@+id/ImageView"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content">
    </ImageView>

     <Gallery
        android:id="@+id/gallery_text"
        android:layout_below="@+id/Gallery_image"
        android:layout_width="fill_parent" 
        android:layout_height="match_parent"
         />
    </RelativeLayout>

我在画廊视图中的开头和结尾的空间。

I have space at the beginning and end of gallery view.

推荐答案

我想这是因为安卓重力=center_horizo​​ntal。同时机器人:填充=15dip补充说:所有四个垫。只添加以下属性来和paddingRight。

I guess that's because android:gravity="center_horizontal". Also android:padding="15dip" adds all four paddings. Add only paddingLeft and paddingRight.

这篇关于如何在画廊中除去空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆