0

I am using Xamarin.Forms to create the UI for my cross platform App. I have created an ActionBar in Android. Now I want style the ActionBar accordingly. Currently, the ActionBar title displays on the extreme left (As per the default behaviour). I have changed the background color and the text color. Now I wish to Align the title in the center and make it bold.

Here is my current resource file for the styling.

<resources>

  <style name="MyTheme" parent="android:Theme.Holo.Light">
    <!-- Customize your theme here. -->
    <item name="android:actionBarStyle">@style/MyActionBar</item>

  </style>

  <style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@color/actionbarbackground</item>
    <item name="android:titleTextStyle">@style/TitleTextStyle</item>
  </style>

  <!-- action bar title text -->
  <style name="TitleTextStyle" parent="@android:style/TextAppearance">
    <item name="android:textColor">@color/white</item>

  </style>
</resources>

I apply it to my activity like this:-

[Activity(Label = "MyApp.Mobile",
        Theme = "@style/MyTheme",
        Icon = "@drawable/icon",
        ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

How can I align and make the font bold? thank you for any suggestions

Michael Irigoyen
  • 22,513
  • 17
  • 89
  • 131
user3034944
  • 1,541
  • 2
  • 17
  • 35
  • This should help - http://stackoverflow.com/questions/19244411/center-align-title-in-action-bar-using-styles-in-android – Will Mar 17 '15 at 05:16
  • @Will Can I add it to the resource file directly? Iam using Xamarin forms so not sure how ot do it. I have edited my question – user3034944 Mar 17 '15 at 05:34

0 Answers0