Creating a custom theme

Put your problem here if it does not fit any of the other categories.

Creating a custom theme

Postby Jesmiatka » Wed Apr 09, 2008 9:50 am

Hey guys,

I wanted to make a custom theme for my application.
I looked up the example code on Google, but that wasn't working (copy pasting their code actually gave errors in the XML file..)
So I tried to look up some information and found a way to set styles so I wrote small amount of code.

Written in res > values > style.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
  3.     <style name="Theme">
  4.         <item name="android:background">#ffffff</item>
  5.         <item name="android:textSize">12sp</item>
  6.         <item name="android:textColor">#7a7b7d</item>
  7.         <item name="android:layout_marginLeft">5px</item>
  8.         <item name="android:layout_marginRight">5px</item>
  9.     </style>
  10. </resources>
Parsed in 0.001 seconds, using GeSHi

This code actually works perfectly for setting styles, but not for setting themes !!
Setting it as a theme will give an exception with Binary XML in it, so i reckon my XML is wrong (duh?). Did anyone else here found out a way to write a legimate Theme?
I can't find any example code online so I am even doubting that it's possible at this moment..

Yours sincerely,
Senior Developer
Senior Developer
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands


Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 3 guests