當前位置:首頁 » 安卓系統 » styleandroid

styleandroid

發布時間: 2025-03-29 03:17:43

① Android TextView怎麼引用Style

1 首先需要在res/values目錄下創建一個styles.xml的文件

<TextView
style="@style/top_recommend_vod_title_style"/>

② Android系統自帶樣式Theme總結

本文從網上復制,給自己做筆記的,摘自: http://blog.csdn.net/hongya1109110121/article/details/11985545

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運行時的樣式。

摘自: http://blog.csdn.net/hongya1109110121/article/details/11985545

③ 為什麼 Android 改變標題欄style 之後 主體都變成黑色了

因為你改了style所以都變成默認的了 要把背景也設置style

④ android中怎麼創建style

自定義樣式方法,可以直接通過定義xml文件來實現不同的樣式:
只需要修改button_style文件,同樣三種狀態分開定義:
Xml代碼
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<gradient android:startColor="#0d76e1" android:endColor="#0d76e1"
android:angle="270" />
<stroke android:width="1dip" android:color="#f403c9" />
<corners android:radius="2dp" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</shape>
</item>

<item android:state_focused="true">
<shape>
<gradient android:startColor="#ffc2b7" android:endColor="#ffc2b7"
android:angle="270" />
<stroke android:width="1dip" android:color="#f403c9" />
<corners android:radius="州源伏2dp" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</shape>
</item>

<item>
<shape>
<gradient android:startColor="#000000" android:endColor="#ffffff"
android:angle="180" />
<stroke android:width="1dip" android:color="#f403c9"冊攜 />
<corners android:radius="5dip" />
<padding android:left="10dp" android:top="10dp"
android:right="10dp" android:bottom="10dp" />
</裂做shape>
</item>
</selector>

gradient 主體漸變 startColor開始顏色,endColor結束顏色 ,angle開始漸變的角度(值只能為90的倍數,0時為左到右漸變,90時為下到上漸變,依次逆時針類推)
stroke 邊框 width 邊框寬度,color 邊框顏色
corners 圓角 radius 半徑,0為直角
padding text值的相對位置

熱點內容
上傳無效的過程調用或參數 發布:2025-03-31 20:20:49 瀏覽:757
網關賬號密碼在哪裡查看 發布:2025-03-31 20:14:21 瀏覽:797
c連接ftp伺服器 發布:2025-03-31 20:06:29 瀏覽:815
達內班深圳java 發布:2025-03-31 19:44:20 瀏覽:765
怎麼發送加密郵件 發布:2025-03-31 19:21:35 瀏覽:970
存儲原油 發布:2025-03-31 19:07:29 瀏覽:841
我的世界伺服器qq群互聊 發布:2025-03-31 19:07:23 瀏覽:706
abc緩存 發布:2025-03-31 19:06:45 瀏覽:812
登錄2b2t伺服器教程電腦版 發布:2025-03-31 19:00:52 瀏覽:725
釘釘解壓器 發布:2025-03-31 19:00:45 瀏覽:371