很久之前就很好奇手機軟件的制作過程,通過study-jams,我要完成我的心愿:
一、 Android:
Android是一款開源的基于Linux的操作系統,主要用于移動設備(手機和平板),也用于汽車,家電等設備上來進入物聯網時代。
說起移動端的操作系統現在常見的有
- 蘋果手機、ipad-----------------------蘋果系統,開發語言:Objective-C或者swift
- 小米,華為,魅族…..安卓設備--------android系統、開發語言:java
可使用Windows,Mac設備通過http://androiddevtools.cn/ 網站來下載相對應的開發工具(Android Studio(推薦使用)/eclipse(停止更新維護))經行開發。
二、認識Android的View(視圖)
- View:翻譯過來為視圖,可以說TextView(文本視圖),ImageView(圖像視圖),Button(按鈕)等等一系列的控件都叫做視圖。
- Layout:所有的View視圖拼起來就是屏幕上的Layout。
- View有TextView(文本視圖),ImageView(圖像視圖),Button(按鈕)等。
三、XML
- XML:Extensible Markup Language 可拓展標記語言,用來編寫布局Layout
- View的命名規則:采用駝峰規則(Camel-Case),也就是將每個單詞的首字母大寫,中間不加任何符號和空格
- 標簽:雙標簽或者自閉標簽(例:<TextView></TextView>或<TextView />)
- 屬性:“=”左邊是屬性名,右變屬性值,每個屬性都有默認值
- 一個在線的視圖預覽工具:http://v.studyjams.cn/
四、控件的認識
- 開啟View的第一個控件:TextView(文本視圖)
<TextView
android:id="@+id/title_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_photos"
android:textAppearance="?android:textAppearanceLarge"
android:textColor="#4689C8"
android:textStyle="bold" />
1.單位:
dp:用于設置控件的寬高
sp:用于設置文本字體的大小
wrap_content:根據內容的大小決定控件的大小
android:textAppearance="?android:textAppearanceLarge"
可以設置系統的屬性,采用大中小字體樣式
2.顏色:
引用系統或者本地資源(@color/White)或者采用16進制“#FFFFFF”
c、Common Android Views 常用基礎控件模板供參考使用
ImageView (圖像視圖)
<ImageView
android:id="@+id/photo_image_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/icon"
android:scaleType="centerCrop"/>
1.android:src:加載本地圖片資源(studio對圖片資源有一定的要求,建議使用.png的文件資源)
2.android:scaleType:對圖片進行一定的裁剪,縮放和位置擺放的操作
通過看Android開發文檔幫助開發
https://developer.android.com/index.html Android開發官網,有Android的API,APP的開發介紹,Material Design語言的介紹等,供開發者查閱學習