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="测试文字居右" />

     

  • 相关阅读:
    RSA算法
    随机数相关面试题
    黑冰
    Servlet
    中国文人的弱点
    黑客与画家
    J2SE、JS及JavaWeb的若干知识
    离婚前规则
    自己写的一个智能指针类
    用_makepath和_splitpath构造路径&分解路径
  • 原文地址:https://www.cnblogs.com/zhangxuechao/p/11772675.html
Copyright © 2011-2022 走看看