zoukankan      html  css  js  c++  java
  • 02-16Android学习进度报告十六

            今天主要学习了GridView(网格视图)的基本使用和一些基本概念。

    下面是GridView中的一些属性:

    • android:columnWidth:设置列的宽度
    • android:gravity:组件对其方式
    • android:horizontalSpacing:水平方向每个单元格的间距
    • android:verticalSpacing:垂直方向每个单元格的间距
    • android:numColumns:设置列数
    • android:stretchMode:设置拉伸模式,可选值如下: none:不拉伸;spacingWidth:拉伸元素间的间隔空隙 columnWidth:仅仅拉伸表格元素自身 spacingWidthUniform:既拉元素间距又拉伸他们之间的间隔空袭

    代码示例:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="5dp">
    
        <ImageView
            android:id="@+id/img_icon"
            android:layout_width="64dp"
            android:layout_height="64dp"
            android:layout_centerInParent="true"
            android:src="@mipmap/iv_icon_1" />
    
        <TextView
            android:id="@+id/txt_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@id/img_icon"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="30dp"
            android:text="呵呵"
            android:textSize="18sp" />
            
    </RelativeLayout>

    这就是今日所学。

  • 相关阅读:
    20180604_Myeclipse下配置SVN报错问题 svn
    20180603_升级Win10后,远程连接桌面连接,出现身份验证错误!
    20180603_navicat 连接sqlserver提示要安装 sql server native client
    VB.net程序实现分页
    多线程Demo
    多线程Demo VB.net
    SQLServer数据库子结构
    SQLServer数据库常用命令
    传播路径图调查2013年初
    拾遗
  • 原文地址:https://www.cnblogs.com/yang2000/p/12323644.html
Copyright © 2011-2022 走看看