Android工程師入門(一)——這周入大門,擠時間,輕噴,android工程師

來源:互聯網
上載者:User

Android工程師入門(一)——這周入大門,擠時間,輕噴,android工程師

擠擠時間,入個門先。

一、環境搭建

略。

二、項目結構

在studio中,項目=Module;

res:放置應用到的所有資源——基本決定了產生的APK的大小;

java:java來源程式;

manifests:資訊清單檔,所有配置的情況,每次執行的第一個訪問地方;

--res

drawable:存放圖片資源;

layout:布局;

menu:菜單專屬布局;

mipmap:Mipmaps早在Android2.2+就可以用了,但是直到4.3 google才強烈建議使用。把圖片放到mipmaps可以提高系統渲染圖片的速度,提高圖片品質,減少GPU壓力;

values:存放字串,主題,顏色,樣式;

三、在介面中輸入以及顯示文字

3.1 控制項概述

TextView:顯示文字框控制項;

EditText:輸入文字框;

--常用屬性

android:id——控制項的id;

android:layout_width——空間的寬度;

~height;

~text——常值內容;

~textSize——文字大小;

~textColor;

~background;

EditText還多兩個:~hint輸入提示文本;inputType輸入文本類型

3.2 實現

在layout中的main.xml中

<!-- wrap_content:包含實際常值內容 match_parent:當前控制項鋪滿父類容器 fill_parent:同上,針對低版本的sdk-->

<TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="match_parent" android:text="姓名:" android:textSize="28sp" android:textColor="#000000" /> <EditText android:hint="請輸入你的姓名" android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="match_parent" />

  

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.