多日的沉寂,今日整理
L1法焰、L2課程合并整理通過一個demo貫穿一下知識點,內(nèi)容如下:
一、android studio(as)的安裝
下載網(wǎng)址:http://androiddevtools.cn/
- 首先在安裝as之前需要先安裝jdk救拉,安裝很簡單,一直next瘫拣。
- 安裝完畢后亿絮,我們還需要配置環(huán)境變量,如下:
1.右擊我的電腦》屬性》高級系統(tǒng)設置》環(huán)境變量》新建
新建系統(tǒng)變量
2.配置JAVA_HOME
JAVA_HOME
3.配置PATH
PATH
4.配置CLASSPATH
CLASSPATH
5.windows鍵+R鍵麸拄,輸入cmd派昧,跳出黑窗口,輸入java -version,出現(xiàn)如下信息拢切,恭喜配置成功蒂萎。
檢測環(huán)境變量是否配置成功
- 下面我們來安裝as:
選擇需要的版本對應下載
- 下載完畢后,進行安裝淮椰,請參考as安裝過程
二五慈、生日賀卡的實現(xiàn)
其實沒有什么復雜的,就是一些控件的擺放和屬性的填寫主穗,多的不多說泻拦,直接代碼貼圖,就是干:
<?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>
- 效果圖如下:
生日賀卡