In my app all the views whose background is set to @background="@android:color/white"
are showed properly on all the devices apart from Samsung Galaxy S3 mini. In this case all these views have a gray background set.
In this specific case the background of the LinearLayout containing the checkboxes should be white:
<LinearLayout
android:id="@+id/ll_child1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:padding="10dp"
android:orientation="vertical" >
...
</LinearLayout>
I tried to replace android:background="@android:color/white"
with android:background="#FFFFFF"
, but the only working solution has be the one of creating a white_bg.xml into my drawable directory:
<item android:bottom="0px">
<shape android:shape="rectangle" >
<solid android:color="@android:color/white" />
</shape>
</item>
and changing the background setting to android:background="@drawable/white_bg"
.
Thought this solves my problem, changing all the layouts in my app is quite annoying, especially because this problem seems to affect in few devices only. I wonder if there's a more elegant solution to this.
Use either the Auto or manual mode to remove the background. Tap on the next icon at the top. Tap on Color tab at the bottom. Using sliders, select the color white.
By default each activity in Android has a white background. To change the background color, first add a new color definition to the colors.
Android App Development for Beginners This example demonstrates about How do I change the color of Button in Android when clicked. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.
Change the "windowBackground" in AppTheme:
In "styles.xml"
<style name="AppTheme" parent="Theme.Holo">
<item name="android:windowBackground">@color/white</item>
</style>
And remove background attribute from your LinearLayout.
Of course make sure your activity using AppTheme as it's theme. (also set @color/white value to "#ffffffff")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With