第一次使用Android Studio時你應該知道的一切配置(二):建立一個屬於自己的工程並安裝Genymotion模擬器,androidgenymotion
【聲明】
歡迎轉載,但請保留文章原始出處→_→
生命壹號:http://www.cnblogs.com/smyhvae/
文章來源:http://www.cnblogs.com/smyhvae/p/4392611.html
連絡方式:smyhvae@163.com
【本文】
都說了放假不休息,奏是這麼任性!!!
【開發環境】
物理機版本:Win7旗艦版(64位)
Android Studio版本:1.1正式版
一、建立工程:
1、建立一個Project:
開啟Android Studio,建立一個Project,介面如下:
1 <com.smyhvae.stickyscrollview.StickyScrollView 2 android:layout_width="match_parent" 3 android:layout_height="match_parent" 4 android:fadingEdge="none" 5 android:overScrollMode="never" 6 android:fillViewport="true" 7 xmlns:android="http://schemas.android.com/apk/res/android"> 8 9 <LinearLayout10 android:layout_width="match_parent"11 android:layout_height="wrap_content"12 android:orientation="vertical">13 14 <View15 android:layout_width="match_parent"16 android:layout_height="200dp"17 android:background="@color/blue"/>18 19 <View20 android:layout_width="match_parent"21 android:layout_height="100dp"22 android:background="@color/red"23 android:tag="sticky"/>24 25 <View26 android:layout_width="match_parent"27 android:layout_height="100dp"28 android:background="@color/green"/>29 <View30 android:layout_width="match_parent"31 android:layout_height="100dp"32 android:background="@color/white"/>33 34 <View35 android:layout_width="match_parent"36 android:layout_height="300dp"37 android:background="@color/purple"/>38 39 <View40 android:layout_width="match_parent"41 android:layout_height="100dp"42 android:background="@color/yellow"/>43 44 </LinearLayout>45 </com.smyhvae.stickyscrollview.StickyScrollView>
上方代碼中,我們引入了StickyScrollView這個module作為library,核心代碼是第23行,我們為紅色的View添加了android:tag="sticky"這個標籤,於是它將具有懸停的屬性。然後直接運行程式就行了。
五、刪除某個module:
中,如果我想刪掉StickyScrollView這個module,該怎麼辦呢?辦法是:選中StickyScrollView這個module,並點擊右鍵,發現沒有delete選項,沒有關係,我們選擇中紅框部分的"Open module Settings"選項,彈出如下介面:
中,點擊箭頭處的減號,就可以刪掉了。同時我們要去掉app這個module對它的依賴:
然後會發現,StickyScrollView這個module的表徵圖消失了:
中,現在右鍵它,就可以delete掉了,而且是從硬碟上直接delete掉:
六、刪除檔案的小技巧:(安全刪除)
如果我們想刪掉某個檔案,可以直接右鍵,然後delete,但是Android Studio有一個更人性化的體驗。比如我想刪掉布局檔案時:
中,點擊delete進行刪除, 彈出如下介面:
中,如果將紅框部分打鉤,然後點擊OK,軟體則會提示你,有哪些地方用到了這個檔案:
顯示,有一個地方用到了這個檔案,點擊中的"View usages",就可以看到詳細的情況了:
如果你執意要刪除,單擊中的箭頭位置即可,怎麼樣?使用者體驗還不錯吧?
怎嗎?還不滿意啊?那我明天繼續戰鬥,敬請期待~~~