將android介面背景設定為黑色

來源:互聯網
上載者:User

標籤:介面   color   

將介面背景設定為黑色的幾種方法:
  • 建立項目時候 第二次next之後(不同sdk版本可能不同),Background Color項點擊可選。
  • 開發布局檔案,選擇視圖查看 就是下邊二個選項卡中的第一個(Graphical),然後上邊有個
    AppTheme點擊->Theme->前三項(Theme.Black等)都可以
  • 在你最外層的layout裡邊設定  android:background="#000000"屬性
  • 在manifest中對應activity屬性中,添加下邊任意一種(設定白色同理,白色色值 #FFFFFF   Theme.Light等)

系統內建樣式Android:theme 
?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="Translucent" 
?android:theme="Theme.Translucent.NoTitleBar" 
?android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 
?android:theme="Theme.Panel" 
?android:theme="Theme.Light.Panel"


再搭個設定編輯框背景的方法
設定編輯框樣式,就是給那個框加個背景圖片,
給一張感受下 http://www.easyicon.net/1116240-input_icon.html下載最大的那個96px的png格式。
下載之後改名(注意不能有大寫字母),然後copy到res檔案夾下任意以drawable開頭的檔案夾下,

在layout檔案中 edittext設定屬性 android:background="@drawable/text_img"


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.