編輯:關於Android編程
Android 配置文件中有icon和logo兩個屬性。那這兩個屬性有什麼區別呢?
清單文件中activity的icon屬性介紹:
android:icon
An icon representing the activity. The icon is displayed to users when a representation of the activity is required on-screen. For example, icons for activities that initiate tasks are displayed in the launcher window. The icon is often accompaniedby a label (see the android:label attribute).
This attribute must be set as a reference to a drawable resource containing theimage definition. If it is not set, the icon specified for the application as awhole is used instead (see the element's icon attribute).
Theactivity's icon — whether set here or by the element— is also the default icon for all the activity's intent filters (see the
大體意思就是說icon代表了一個activity,它作為activity的界面顯示展示給用戶,比如說啟動界面上MainActivity的圖標。此外,它的屬性值必須是一個drawable類型的資源文件。如果沒有給activity定義,那麼這個activity會使用application的icon屬性。
下面是application的icon屬性介紹:
android:icon
An iconfor the application as whole, and the default icon for each of theapplication's components. See the individual icon attributesfor , ,
This attribute must be set as a reference to a drawable resource containing the image (for example@drawable/icon).There is no default icon.
同activity的icon屬性類似,但是application的icon屬性石沒有默認值的。aplication的icon屬性是用來顯示在安裝界面和安裝包縮略圖的,而不包括桌面和啟動器圖標。桌面、啟動器上顯示的圖是應用的主activity(一般名稱為MainActivity)裡icon。
logo屬性介紹:
android:logo
A logo for the application as whole, and the default logofor activities.
This attribute must be set as a reference to a drawableresource containing the image (for example@drawable/logo). There is no default logo.
logo不會被作為桌面圖標,僅作為activity的導航圖,而當同時設置了icon與logo屬性時(閒的),logo會完全覆蓋掉icon。
By default, the systemuses your application icon in the action bar, as specified by the icon attribute in the or element. However, if you also specifythe logo attribute, then the action bar usesthe logo image instead of the icon.
A logo should usually bewider than the icon, but should not include unnecessary text. You shouldgenerally use a logo only when it represents your brand in a traditional format that users recognize. A good example is the YouTube app's logo—the logorepresents the expected user brand, whereas the app's icon is a modifiedversion that conforms to the square requirement for the launcher icon.
ActionBar的應用:
ActionBar actionBar=getActionBar();
使用android:logo屬性。不像方方正正的icon,logo的圖像不會有任何寬度限制
當你有Logo的時候,你可以隱藏label。隱藏Label標簽:
actionBar.setDisplayShowTitleEnabled(false);
隱藏logo和icon:
actionBar.setDisplayShowHomeEnabled(false);
默認情況下,actionBar放在你的activity的頂部,且作為activity布局的一部分。設置成為覆蓋模式後,actionBar相當於漂浮在activity之上,不干預activity的布局。
在介紹本文動畫效果實現之前,先來介紹屬性動畫相關的幾個知識點。ValueAnimator與ObjectAnimator。 Interpolator插值器與TypeEval
感覺用到的次數無比多,要是要把它記下來,免得要用的時候又要重來一遍(個人記性太差)先看效果圖接下來,說說要怎麼寫1.首先在.gradle中添加一個jar包gradle-w
概念:LruCache什麼是LruCache?LruCache實現原理是什麼?這兩個問題其實可以作為一個問題來回答,知道了什麼是 LruCache,就只然而然的知道 Lr
Activity:package com.wkk.app8;import android.annotation.TargetApi;import android.app.
Working with System PermissionsTo pr