多日的沉寂,今日整理
L1、L2课程合并整理通过一个demo贯穿一下知识点,内容如下:
一、android studio(as)的安装
下载网址:http://androiddevtools.cn/
- 首先在安装as之前需要先安装jdk,安装很简单,一直next。
- 安装完毕后,我们还需要配置环境变量,如下:
1.右击我的电脑》属性》高级系统设置》环境变量》新建

2.配置JAVA_HOME

3.配置PATH

4.配置CLASSPATH

5.windows键+R键,输入cmd,跳出黑窗口,输入java -version,出现如下信息,恭喜配置成功。

- 下面我们来安装as:

- 下载完毕后,进行安装,请参考as安装过程
二、生日贺卡的实现
其实没有什么复杂的,就是一些控件的摆放和属性的填写,多的不多说,直接代码贴图,就是干:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:padding="20dp"
tools:context="com.example.bf.birthday.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="To:Study Jams"
android:textColor="@android:color/white"
android:typeface="serif"
android:textSize="35sp"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/img_birthday"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:text="From:KongBF"
android:typeface="serif"
android:textColor="@android:color/white"
android:textSize="35sp"/>
</RelativeLayout>
- 效果图如下:

网友评论