跳到主要內容

【Review Android Development for Beginner】Lesson 1A : Android 軟體畫面基礎


第一課:Views


Views 是指一個App當中你所看到的東西,不管是文字、圖片、按鈕,都是一種View。

以此圖為例,可以看到許多種View,並給大家一個小小的Quiz作為練習。


此為Youtube程式入口畫面,在此畫面中也有許多不一樣的Views

藉由上面的練習,在這個單元最重要的課程內容就是希望各位可以初步了解軟體畫面的基本構成元素。


TextView


基本構成元素:

  1. 在一個View中,前後都會有個箭號括弧(綠色),且後面必須以正斜線做收尾。
  2. 需要以android :來做開頭,接著會鍵入所需要修改的元素,舉例:android:text。
  3. 基本上只要是一個View,我們都會去定義他的範圍框架。



什麼XML?

XML 是一種可延伸式標記語言。而要製作 Android  軟體畫面的環境語言稱為 XML。
其中 TextView 是 XML 的一個元素(Element),概念有點像是物件。
用於描述這個 TextView 物件的,稱為 Attribute

一個 element 通常會在一個 Self-closing tag  當中,其中包含 < ____/>

其他參考資料:
XML (Wiki): Link
HTML與XML有什麼分別?(EzTrust) : Link

Using XML Visualizer to do those tasks below.



Find out the errors ( tips: 4 errors)


wrap_content
這個是可以用來記錄attribute狀態的_____(暫時不知道怎麼表達),但當使用Wrap_content的時候,所有在這個TextView裡面的文字就會被包覆。

textSize
這個是用來調整字體大小的一個attribute(單位sp),但是為了App美觀,我們也可以使用單位字級(指的是預設的幾種字型大小),可以不用一直調整字體的大小,attribute名稱android:textAppearance="?android:textAppearanceLarge"

textColor
這是用來調整字體顏色的attribute,一般而言撰寫方式為:
android:textColor="#E65100"


ImageView


Use XML visualizer 完成以下幾個 tasks


scaleType
用來調整 imageView的大小,撰寫方式:
android:scaleType="center"

對於App的畫面語法有了基礎的了解之後,在此希望自己可以去查更多的資料。




留言

這個網誌中的熱門文章

【Quora 翻譯&整理】對於程式初學者嘗試解決問題的好網站推薦

原文出處: What are some suggested websites to solve programming problems for beginners? (2016/5/15) 此篇文章強調的是去參加project的那種網站推薦

第一章 電腦、網際網路與全球資訊網簡介

C++  How to Program 7/E 筆記 第一章 電腦、網際網路與全球資訊網簡介 學習目標 基本軟硬體觀念 物件技術觀念(類別、物件、屬性、行為、封裝、繼承) 程式語言的種類 典型的C++開發環境 業界標準物件導向素模語言——UML 沿革 網際網路、球球資訊網與Web 2.0現象的沿革 在Linux 的GNU C++ 與在Microsoft Visual C++環境中測試C++ 應用程式 *結構化程式設計(structured programming) *物件導向程式設計

【 Intro to Java Programming 】Lesson 1 : Introduction-5 (Algorithms)

This Notes is according to the udacity free course : Intro to Java Programming Lesson 1 : Introduction-5(Algorithms) Key Word : pseudocode Algorithms just like a doing things protocol+condition. Without protocol+condition, you can not make choice or do the decision. So if you want to buy car, you know the car speed and you don't consider the car price or the car condition, so it is your thought, it is the algorithm you buy a car. For computer, we give them the program ===>for them to do algorithm, but now we try to write done in Pseudocode. Pseudocode write in "spoken language" which help us to understand the problem so we can translate them into computer language ==>JAVA Code.org maybe it could help you have fun from learning code