Skip to main content

Posts

Showing posts from December, 2010

Styling portions of Text in Android TexView

A  simple way to style portions of text in  TextView Objects  is by using a string resource; you can add some  simple styling, such as blod or italic using HTML notion. For example, in res/value/strings.xml you could declare this: <string name="quickfacts">  <b>Inhabitant in Tunisia:</b>"\n" ca 10 million "\n\n" <b>Official Language:</b>"\n" Arabic (French as a second language)"\n\n"  <b>Currency</b>"\n" Tunisian Dinar (TND)"\n\n" <b>Country Code:</b>"\n" 216"\n\n" <b>Time Zone:</b>"\n" GMT + 1 hour"\n\n" <b>Religion:</b>"\n" Islam"\n\n" </string> Styling text diaplayed in a textView objetct:

Custom Android Title Bar

To customize the Android Title bar you need to define custom styles and apply those styles to a custom theme. Under the folder "Values"  create your "styles.xml"  file. <?xml version="1.0" encoding="utf-8"?> <resources> <!--    Changing the text style of title bar-->     <style name="CustomTitleBarText" parent="android:TextAppearance.WindowTitle">           <item name="android:textSize">18dip</item>           <item name="android:textColor">#FFFFFF</item>           <item name="android:textStyle">bold</item>                      </style>      <!-- Changes the background color of the title bar -->      <style name="CustomTitleBarBackground">            ...