zoukankan      html  css  js  c++  java
  • Android 布局测试

    wrap_content

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="测试填满父控件的空白" />

    layout_marginTop

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:text="测试与上边的距离" />

    layout_marginLeft

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="50dp"
        android:text="测试与左边距离" />

     

    paddingLeft

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingLeft="40sp"
        android:text="测试空间内左边距" />

    padding

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="20sp"
        android:paddingBottom="20sp"
        android:paddingLeft="40sp"
        android:paddingRight="40sp"
        android:text="测试空间内边距" />

    gravity

    <Button
        android:id="@+id/button1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:text="测试文字居中" />

    <Button
        android:id="@+id/button1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="left"
        android:text="测试文字居左" />

    <Button
        android:id="@+id/button1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="right"
        android:text="测试文字居右" />

     

  • 相关阅读:
    Aruduino un0 spi oled官方代码
    排序--之快速排序
    用arduino UNO R3板为pro mini板烧录bootloaders
    数码管显示
    gdb高级功能与配置
    ROS中调试c++程序
    自引用结构--之创建双向遍历的链表
    数据文件——将从键盘设备文件读取文本将其写入显示器设备文件
    数据文件——将文本写入显示器设备文件
    ifcfg-eth0
  • 原文地址:https://www.cnblogs.com/zhangxuechao/p/11772675.html
Copyright © 2011-2022 走看看