更改主題操作方法:
我們提供的服務有:網站制作、成都網站建設、微信公眾號開發、網站優化、網站認證、北川羌族ssl等。為上1000+企事業單位解決了網站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術的北川羌族網站制作公司
1.自帶主題更改:設置-主題-默認/Pink/Space/主題商店,使用時按照提示下載后即可應用。
2.您可以通過應用商店或其它方式下載主題(.APK格式)。下載完成后,打開下載的主題軟件,選擇應用即可。
Android 應用程序中使用自定義主題的方法:
1、新建一個項目 Lesson32_StyleAndTheme。
2、拷貝下面三張 Nine-Patch PNG圖片到res/drawable目錄下:
3、在按鈕的同目錄下建立一個文件btn_custom.xml,把上述3張圖片整合成一個按鈕背景文件,讓三張圖片成為不同狀態下的按鈕表現效果。具體寫法如下:
?xml?version="1.0"?encoding="utf-8"?
selector?xmlns:android=""??
item?android:drawable="@drawable/btn_red"?android:state_enabled="false"
item?android:drawable="@drawable/btn_orange"?android:state_enabled="true"?android:state_pressed="true"
item?android:drawable="@drawable/btn_orange"?android:state_enabled="true"?android:state_focused="true"
item?android:drawable="@drawable/btn_black"?android:state_enabled="true"
/item/item/item/item/selector
4、在res/values目錄下定義style.xml文件,內容如下:
?xml?version="1.0"?encoding="utf-8"?
resources
style?name="BasicButtonStyle"?parent="@android:style/Widget.Button"
item?name="android:gravity"center_vertical|center_horizontal/item
item?name="android:textColor"#ffffffff/item
item?name="android:shadowColor"#ff000000/item
item?name="android:shadowDx"0/item
item?name="android:shadowDy"-1/item
item?name="android:shadowRadius"0.2/item
item?name="android:textSize"16dip/item
item?name="android:textStyle"bold/item
item?name="android:background"@drawable/btn_custom/item
item?name="android:focusable"true/item
item?name="android:clickable"true/item
/style
style?name="BigTextStyle"
item?name="android:layout_margin"5dp/item
item?name="android:textColor"#ff9900/item
item?name="android:textSize"25sp/item
/style
style?name="BasicButtonStyle.BigTextStyle"
item?name="android:textSize"25sp/item
/style
/resources
5、在res/layout/目錄下定義main.xml文件,內容如下:
?xml?version="1.0"?encoding="utf-8"?
linearlayout?xmlns:android=""?android:layout_height="fill_parent"?android:layout_width="fill_parent"?android:orientation="vertical"
textview?android:layout_height="wrap_content"?android:layout_width="fill_parent"?android:text="張信哲的熱搜歌曲"
button?android:layout_height="wrap_content"?android:layout_width="wrap_content"?android:text="愛如潮水?"?android:id="@+id/Button01"
/button
/textview/linearlayout
6、在res/values目錄下定義theme.xml文件:
?xml?version="1.0"?encoding="utf-8"?
resources????????
style?name="BasicButtonTheme"
item?name="android:buttonStyle"@style/basicbuttonstyle/item
item?name="android:windowBackground"@android:color/transparent/item??
item?name="android:windowIsTranslucent"true/item??
/style
/resources
7、在AndroidManifest.xml中給整個應用程序設置主題:
?xml?version="1.0"?encoding="utf-8"?
manifest?xmlns:android=""?package="android.basic.lesson32"?android:versioncode="1"?android:versionname="1.0"??
application?android:theme="@style/BasicButtonTheme"?android:label="@string/app_name"?android:icon="@drawable/icon"
activity?android:label="@string/app_name"?android:name=".MainStyleAndTheme"
intent?-filter=""
action?android:name="android.intent.action.MAIN"
category?android:name="android.intent.category.LAUNCHER"
/category/action/intent
/activity
/application
uses?-sdk=""?android:minsdkversion="8"
/uses/manifest
8、程序的最終運行效果圖如下:
在Android中我們經常需要設置屏幕頂部狀態欄的主題和應用頁面保持同一風格,本文介紹幾種常用的設置方案:
首先給出一張圖:
2 2
通過上圖,我們可以通過設置不同的屬性來達到控制不同位置顏色的目的,下面給出使用示例,修改res/values-19里面的內容:
主要是設置 colorPrimary,colorPrimaryDark這兩個屬性的值來設置狀態欄的顏色,需要注意的是:
1:AndroidManifest.xml文件中的targetSdkVersion必須設置在 21 以上。
2.parent主題必須是 Theme.AppCompat 開頭,兼容包下的主題,所以必須一用 v7 包。
在頂部標題欄設置屬性值達到風格一致的目的
首先修改res/values-v19文件夾下的styles.xml文件內容如下(如果沒有可以新建一個):
然后設置頂部標題控件的兩個屬性:
這時狀態欄會保持與設置fitsSystemWindow屬性的控件的背景顏色一致。
本文從網上復制,給自己做筆記的,摘自:
Android系統自帶樣式(@android:style/) (轉)
1 android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen"
布局頁面最上面 不會顯示? android:icon="@drawable/ic_launcher"中的值和android:label="@string/app_name"的值。
2 android:theme="@style/AppTheme"
布局頁面最上面 顯示? android:icon="@drawable/ic_launcher"中的值和android:label="@string/app_name"的值。
其他
在AndroidManifest.xml文件的activity中配置
1、android:theme="@android:style/Theme"
默認狀態,即如果theme這里不填任何屬性的時候,默認為Theme
2、android:theme="@android:style/Theme.NoDisplay"
任何都不顯示。比較適用于只是運行了activity,但未顯示任何東西
3、android:theme="@android:style/Theme.NoTitleBar“
背景主題的沒有標題欄的樣式,默認如果沒有設置的話,顯示黑背景
4、android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
背景主題的沒有標題欄且全屏的樣式,默認為黑背景
5、android:theme="@android:style/Theme.Black"
默認狀態下黑背景
6、android:theme="@android:style/Theme.Black.NoTitleBar"
黑背景主題的沒有標題欄的樣式
7、android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
黑背景主題的沒有標題欄且全屏的樣式
8、android:theme="@android:style/Theme.Light"
默認狀態下亮背景,與上述黑背景Theme.Black相反
9、android:theme="@android:style/Theme.Light.NoTitleBar"
亮背景主題的沒有標題欄的樣式,與Theme.Black.NoTitleBar相反
10、android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen"
亮背景主題的沒有標題欄且全屏顯示的樣式,與Theme.Black.NoTitleBa.Fullscreenr相反
11、android:theme="@android:style/Theme.Dialog"
對話框樣式 將整個activity變成對話框樣式出現
12、android:theme="@android:style/Theme.InputMethod"
Window animations that are applied to input method overlay windows
13、android:theme="@android:style/ Theme.Panel"
刪除掉所有多余的窗口裝飾,在一個空的矩形框中填充內容,作用范圍相當于把dialog中的所有元素全部去掉,只是一個空的矩形框,且此為默認的樣式
14、android:theme="@android:style/ Theme.Light.Panel"
刪除掉所有多余的窗口裝飾,在一個空的矩形框中填充內容,作用范圍相當于把dialog中的所有元素全部去掉,只是一個空的矩形框,且默認是light的樣式
15、android:theme="@android:style/Theme.Wallpaper"
使用墻紙做主題,默認狀態。
16、android:theme="@android:style/ Theme.WallpaperSettings"
使用墻紙做主題,默認是使用將上一個界面調暗之后作為主題
17、android:theme="@android:style/ Theme.Light.WallpaperSettings"
使用墻紙做主題,默認Light狀態
18、android:theme="@android:style/Theme.Wallpaper.NoTitleBar"
使用墻紙做主題,且沒有標題欄
19、android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
使用墻紙做主題,且沒有標題欄,且全屏顯示
20、android:theme="@android:style/Theme.Translucent"
半透明狀態下的背景,將運行此activity之前的屏幕作為半透明狀態作為此activity運行時的樣式。
21、android:theme="@android:style/Theme.Translucent.NoTitleBar"
半透明狀態下沒有標題欄的背景,將運行此activity之前的屏幕作為半透明狀態作為此activity運行時的樣式。
22、android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
半透明狀態下沒有標題欄且全屏的背景,將運行此activity之前的屏幕作為半透明狀態作為此activity運行時的樣式。
摘自:
android:theme="@android:style/Theme.Dialog" //Activity顯示為對話框模式
android:theme="@android:style/Theme.NoTitleBar" //不顯示應用程序標題欄
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" //不顯示應用程序標題欄,并全屏
android:theme="Theme.Light " //背景為白色
android:theme="Theme.Light.NoTitleBar" //白色背景并無標題欄
android:theme="Theme.Light.NoTitleBar.Fullscreen" //白色背景,無標題欄,全屏
android:theme="Theme.Black" //背景黑色
android:theme="Theme.Black.NoTitleBar" //黑色背景并無標題欄
android:theme="Theme.Black.NoTitleBar.Fullscreen" //黑色背景,無標題欄,全屏
android:theme="Theme.Wallpaper" //用系統桌面為應用程序背景
android:theme="Theme.Wallpaper.NoTitleBar" //用系統桌面為應用程序背景,且無標題欄
android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" //用系統桌面為應用程序背景,無標題欄,全屏
android:theme="Theme.Translucent" //透明背景
android:theme="Theme.Translucent.NoTitleBar" //透明背景并無標題
android:theme="Theme.Translucent.NoTitleBar.Fullscreen" //透明背景并無標題,全屏
android:theme="Theme.Panel " //面板風格顯示
android:theme="Theme.Light.Panel" //平板風格顯示
主題一:Darcula,就是當今最流行的背景主題,
主題二:Intellij,灰白系列,相比第三個windows主題更好看一些,但個人還是覺得Darcula最好。
網站題目:android主題,android主題下載動漫
URL地址:http://vcdvsql.cn/article8/dsdiiop.html
成都網站建設公司_創新互聯,為您提供用戶體驗、做網站、標簽優化、企業網站制作、網站收錄、域名注冊
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯