layout_margin设置按钮距父边框的位置
paddingTop设置按钮上的字的位置
看一下效果图
paddingTop设置按钮上的字的位置
hint设置默认的输入
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#cccfff"
android:orientation="vertical"
>
<!--
layout_margin设置按钮距父边框的位置
paddingTop设置按钮上的字的位置
hint设置默认的输入
-->
<Button
android:id="@+id/button1"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_margin="20dp"
android:paddingTop="50dp"
android:textSize="20sp"
android:text="属性" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="请输入用户名"
android:ems="10" />
</LinearLayout>
看一下效果图