UI篇(初识君面)

       我们的APP要想吸引用户,就要把UI(脸蛋)搞漂亮一点。毕竟好的外貌是增进人际关系的第一步,我们程序员看到一个APP时,第一眼就是看这个软件的功能,不去关心界面是否漂亮,看到好的程序会说“我cao!这个功能写得很NB”。两者都很重要。下面我们先来首诗,然后进入正题:

      诗曰:

             忆昔花间初识面,红袖半遮,妆脸轻转。石榴裙带,故将纤纤玉指偷捻,双凤金线。
             碧梧桐锁深深院,谁料得两情,何日教谴绻?羡春来双燕,飞到玉楼,朝暮相见。

     创建新的项目,拖拽TextView,Button,EditText,分别对着几个进行讲解:

    <TextView
android:layout_width="wrap_content"--对齐的方式,有两种可以选
android:layout_height="wrap_content"
android:text="暗里着迷"
android:gravity="top"--布局的方式,多个可选
android:textSize="80sp"字体大小
android:layout_marginTop="12dp"
android:id="@+id/textView"

android:layout_alignParentStart="true" />


<Button android:id="@+id/Btn_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="按钮"
android:layout_below="@+id/lrc"
android:layout_alignStart="@+id/lrc"
android:layout_marginStart="55dp"
android:layout_marginTop="27dp"/>

<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"

android:ems="10"
android:layout_below="@+id/Btn_ok"
android:layout_alignStart="@+id/lrc"
android:layout_marginTop="37dp"
android:id="@+id/editText"
android:hint="这时是编辑器,可以写入内容。例:暗里着迷"--这里实现编辑框中提示,当用会输入是自动消失
android:maxLines="3"--最多允许的行数,超过会把之前的向上移,不会改变编辑器的大小
/>


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="
可不可不要这么样徘徊在目光内
你会察觉到我根本寂寞难耐
即使千多百个深夜曾在梦境内"
android:id="@+id/lrc"
android:gravity="left"

android:layout_alignParentStart="true"
android:layout_marginStart="10dp"
android:layout_marginTop="140dp"
android:textSize="18sp"
android:textColor="#00ff00"
/>


原文地址:https://www.cnblogs.com/c546170667/p/6143267.html