zoukankan      html  css  js  c++  java
  • Android GridView 行间距过大(一页一行)

    1.  gridView.xml中

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/beijing"
    android:orientation="vertical" >

    <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/blacktitle" >

    <Button
    android:id="@+id/btnbacktui"
    android:textColor="@color/textcolor"
    android:layout_alignParentLeft="true"
    android:layout_centerVertical="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/btn_back"
    android:text="@string/fanhui" />

    <TextView
    android:id="@+id/tuiName"
    android:textColor="@color/textcolor"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:textSize="18sp" />

    </RelativeLayout>

    <GridView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:verticalSpacing="15dip"
    android:horizontalSpacing="5dip"
    android:numColumns="3"
    android:id="@+id/gridviewId"
    />
    </LinearLayout>

    2.  adapter.xml中

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

    <!-- android:background="@drawable/beijing"  在此文件文件中不需要--> 
    <ImageView
    android:layout_width="300dip"
    android:layout_height="100dip"
    android:id="@+id/imageId"
    android:layout_gravity="center"
    />
    <TextView
    android:layout_width="80dip"
    android:layout_height="wrap_content"
    android:id="@+id/imageTextId"
    android:textColor="@color/content"
    android:layout_gravity="center"
    />

    </LinearLayout>

  • 相关阅读:
    001 :PCL 的基本文件类型PCD的读入和写入操作
    CMake +Vs2017+快速搭建pcl1.9.1环境
    Window 10 PCL-1.91+VS2017 源码编译以及安装pcl
    Eigen3+Cmake+Vs2017源码编译
    将Opencv加入到环境变量中
    004 :opencv 中矩阵操作以及通过内存的方式取像素
    ubuntu16.04与win10双系统安装 无法将grub-efi-amd64-signed 软件包安装到/target/中
    简单了解一下PyTest-sq
    软件测试工程师笔试题
    TT-反射-对象拷贝
  • 原文地址:https://www.cnblogs.com/syxxlove/p/3486529.html
Copyright © 2011-2022 走看看