小程序开发-选择一个皮肤(选择Angela皮肤)

小程序开发


浏览:1204 次

准备阶段

1.面向对象-逐步

编写文本框以显示名称

编写输入框

编写文本框以显示密码

编写输入框

编写按钮

编写函数接受用户输入的名称

编写一个函数以接收用户输入的密码

编写接收用户点击事件的函数

(可重用性低)

2.面向对象-行为

编写类似TextView的文本颜色字体(用于管理文本的相应内容)

创建对象

编写类EditText以显示输入内容

创建对象

按钮

让我们以栗子为例

盖房子

人:效用思想(一类)

张三:特定人(对象)

连接手机以打开开发者程序

LinearLayout和RelativeLayout

线条布局

RelativeLayout(需要约束才能达到预期效果)

因此,在此处使用LinearLayout更合适

生成页面

xmlns:app=“https://schemas.android.com/apk/res-auto "

xmlns:tools=“https://schemas.android.com/tools "

android:layout_width=“match_parent”

android:layout_height=“match_parent”

工具:context=“.MainActivity”

android:orientation=“vertical”>