zoukankan      html  css  js  c++  java
  • Margin和Padding的区别

    Margin和Padding的区别

    一、简介

    二、实例

    效果图

    代码

    /MarginAndPadding/res/layout/activity01.xml

     1 <?xml version="1.0" encoding="utf-8"?>
     2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     3     android:layout_width="match_parent"
     4     android:layout_height="match_parent"
     5     android:orientation="vertical" >
     6 
     7     <TextView 
     8         android:layout_width="wrap_content"
     9         android:layout_height="wrap_content"
    10         android:background="@android:color/darker_gray"
    11         android:text="margin案例一"
    12         android:layout_marginTop="30dp"
    13         android:layout_marginLeft="30dp"
    14         />    
    15         
    16     <TextView 
    17         android:layout_width="wrap_content"
    18         android:layout_height="wrap_content"
    19         android:background="@android:color/darker_gray"
    20         android:text="margin案例二"
    21         android:layout_margin="60dp"
    22         />    
    23         
    24     <TextView 
    25         android:layout_width="wrap_content"
    26         android:layout_height="wrap_content"
    27         android:background="@android:color/darker_gray"
    28         android:text="padding案例一"
    29         android:layout_alignParentRight="true"
    30         android:paddingTop="30dp"
    31         android:paddingLeft="30dp"
    32         />    
    33         
    34     
    35 </RelativeLayout>
  • 相关阅读:
    Msql-51CTO笔记
    Elasticsearch 学习第一天
    大数据开发参考资料
    1.docker的安装
    java_根据实体字段中的中文汉字排序
    遍历set集合,进行数据的拼接
    关于integer 和int
    03.linux环境安装mysql8的安装包
    02.linux下面安装jdk8
    01.VMware15.5下安装Centos7
  • 原文地址:https://www.cnblogs.com/Renyi-Fan/p/7290115.html
Copyright © 2011-2022 走看看