Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Background Color

$
0
0

I ended up using the generator here:

http://jgilfelt.github.com/android-actionbarstylegenerator/

My background color in my android app is a light gray and I want it to be pure white "FFFFFF". How do I either edit the theme/style xml files or set it in MainActivity.cs in order for it to be application wide.

The reason I want to do this is also because my WebViews with plain html have a pure white background even when I set the color to transparent. I also just want the background to be white in general.

In my styles.xml file:

<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator

     Copyright (C) 2011 The Android Open Source Project
     Copyright (C) 2012 readyState Software Ltd

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<resources>

    <style name="Example" parent="@android:style/Theme.Holo.Light.DarkActionBar">
        <item name="android:actionBarItemBackground">@drawable/selectable_background_example</item>
        <item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Example</item>
        <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Example</item>
        <item name="android:actionDropDownStyle">@style/DropDownNav.Example</item>
        <item name="android:actionBarStyle">@style/ActionBar.Solid.Example</item>
        <item name="android:actionModeBackground">@drawable/cab_background_top_example</item>
        <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_example</item>
        <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Example</item>
                <!-- Light.DarkActionBar specific -->
        <item name="android:actionBarWidgetTheme">@style/Theme.Example.Widget</item>
    </style>

    <style name="ActionBar.Solid.Example" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@drawable/ab_solid_example</item>
        <item name="android:backgroundStacked">@drawable/ab_stacked_solid_example</item>
        <item name="android:backgroundSplit">@drawable/ab_bottom_solid_example</item>
        <item name="android:progressBarStyle">@style/ProgressBar.Example</item>
    </style>

    <style name="ActionBar.Transparent.Example" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">@drawable/ab_transparent_example</item>
        <item name="android:progressBarStyle">@style/ProgressBar.Example</item>
    </style>

    <style name="PopupMenu.Example" parent="@android:style/Widget.Holo.ListPopupWindow">
        <item name="android:popupBackground">@drawable/menu_dropdown_panel_example</item>   
    </style>

    <style name="DropDownListView.Example" parent="@android:style/Widget.Holo.ListView.DropDown">
        <item name="android:listSelector">@drawable/selectable_background_example</item>
    </style>

    <style name="ActionBarTabStyle.Example" parent="@android:style/Widget.Holo.ActionBar.TabView">
        <item name="android:background">@drawable/tab_indicator_ab_example</item>
    </style>

    <style name="DropDownNav.Example" parent="@android:style/Widget.Holo.Spinner">
        <item name="android:background">@drawable/spinner_background_ab_example</item>
        <item name="android:popupBackground">@drawable/menu_dropdown_panel_example</item>
        <item name="android:dropDownSelector">@drawable/selectable_background_example</item>
    </style>

    <style name="ProgressBar.Example" parent="@android:style/Widget.Holo.ProgressBar.Horizontal">
        <item name="android:progressDrawable">@drawable/progress_horizontal_example</item>
    </style>

    <style name="ActionButton.CloseMode.Example" parent="@android:style/Widget.Holo.ActionButton.CloseMode">
        <item name="android:background">@drawable/btn_cab_done_example</item>
    </style>

    <!-- this style is only referenced in a Light.DarkActionBar based theme -->
    <style name="Theme.Example.Widget" parent="@android:style/Theme.Holo">
        <item name="android:popupMenuStyle">@style/PopupMenu.Example</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Example</item>
    </style>

</resources>

Viewing all articles
Browse latest Browse all 58056

Trending Articles