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>

    这就是今日所学。

  • 相关阅读:
    sql注入漏洞与防范
    微信小程序-工具,弹出当前系统代理不是安全代理处理方法
    微信小程序-02 小程序关注组件
    微信小程序-01 小数保留二位
    http 转hhttps
    php 函数-ksort
    iOS 原生二维码扫描
    iOS 打包错误 all-product-headers.yaml' not found
    iOS Tableview点击cell 会往上跳
    WKWebView 使用
  • 原文地址:https://www.cnblogs.com/yang2000/p/12323644.html
Copyright © 2011-2022 走看看