Theme on a preferences screen

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Theme on a preferences screen

Postby avolovoy » Wed Jan 21, 2009 9:57 pm

I need to change a background on
<PreferenceCategory android:title="Appearance">
and set a custom background image for the whole settings activity
How i can do that via themes ?
which attributes need to overwrite ?
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Top

Postby MrSnowflake » Wed Jan 21, 2009 11:16 pm

Can't you make the background of the Preference activity, which you already have to extend, transparent by code?
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby avolovoy » Wed Jan 21, 2009 11:53 pm

This gave me a background and overwrote the categoryStyle, but didn't set new background for the category.
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.   <style name="Theme" parent="android:Theme.Light">
  2.  
  3.     </style>
  4.  
  5.    
  6.  
  7.      <style name="PCategory">    
  8.  
  9.       <item name="android:background">#5E829E</item>    
  10.  
  11.       <item name="android:height">50px</item>      
  12.  
  13.       <item name="android:textStyle">bold</item>
  14.  
  15.                 <item name="android:textSize">12.0sp</item>
  16.  
  17.                 <item name="android:textColor">#FFFFFF</item>
  18.  
  19.                 <item name="android:shadowColor">#000000</item>
  20.  
  21.                 <item name="android:shadowDx">1.4</item>
  22.  
  23.                 <item name="android:shadowDy">1.4</item>
  24.  
  25.                 <item name="android:shadowRadius">1.9</item>
  26.  
  27.     </style>
  28.  
  29.       <style name="Theme.Express">
  30.  
  31.          <item name="android:preferenceCategoryStyle">@style/PCategory</item>
  32.  
  33.         <item name="android:listViewStyle">@style/Widget.ListView</item>    
  34.  
  35.        
  36.  
  37.        </style>
  38.  
  39.    
  40.  
  41.     <style name="Widget" parent="android:Widget">
  42.  
  43.     </style>
  44.  
  45.     <style name="Widget.AbsListView">
  46.  
  47.         <item name="android:scrollbars">vertical</item>
  48.  
  49.         <item name="android:fadingEdge">vertical</item>
  50.  
  51.         <item name="android:scrollbarStyle">outsideInset</item>
  52.  
  53.     </style>
  54.  
  55.    
  56.  
  57.     <style name="Widget.ListView" parent="Widget.AbsListView">                 
  58.  
  59.         <item name="android:background">@drawable/background</item>
  60.  
  61.    
  62.  
  63.     </style>
Parsed in 0.006 seconds, using GeSHi 1.0.8.4
Alexey Volovoy
Bytesharp.NET
User avatar
avolovoy
Experienced Developer
Experienced Developer
 
Posts: 68
Joined: Mon Nov 03, 2008 10:32 pm
Location: kansas

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 6 guests