<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:hint="qq号/微信号/email"
android:drawableLeft="@mipmap/zhanghao"
/>
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:hint="你妈的密码"
android:drawableLeft="@mipmap/mima"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="登录啦"
android:textColor="#E0F7FA"
android:background="#00BCD4"
android:textSize="17dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="登录遇到的问题"
android:layout_gravity="center_horizontal"
android:paddingTop="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
主要内容是线型布局管理器
实现的效果图如下:
不难,挺简单的,感觉,大家坚持学就行啦,冲冲冲
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:foreground="@mipmap/b"
android:foregroundGravity="right|bottom"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
tools:context=".MainActivity">
<TextView
android:layout_width="280dp"
android:layout_height="280dp"
android:layout_gravity="center"
android:text="Hello World!"
android:background="#F10A0A"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="250dp"
android:layout_height="250dp"
android:background="#1260D8"
android:layout_gravity="center"
android:text="what the fuck"
/>
<TextView
android:layout_width="150dp"
android:layout_height="150dp"
android:background="#13DF0D"
android:layout_gravity="center"
android:text="哈哈哈哈哈"/>
</FrameLayout>