0

I have a ListView with some rows and a custom checkbox on the right hand side. On my OS 4.4 Nexus 4 it seems like a gentle gradient is being applied to the list row backgrounds, creating an ugly artifact on the checkboxes (they disappear half way down, and then invert for the bottom half). On other devices I don't see this problem, and I also don't see it in an OS 4.4.2 emulator.

I haven't been able to find any information online about this, so I'm not sure if it's specific to the device, or the exact OS flavor.

Is this something I can disable? If not, what advice should I give my asset designer?

Here's a screenshot:

screen gradient

4

3 回答 3

1

The Holo.Light theme uses a subtle grey gradient background. It might only be more apparent on one of your devices due to the screen's contrast/brightness.

You can just set the background to solid white by using the android:windowBackground tag in your Activity's theme:

<style name="SolidWhiteTheme" parent="android:Theme.Holo.Light">
  <item name="android:windowBackground">@android:color/white</item>
  <item name="android:colorBackground">@android:color/white</item>
</style>

And then applying the theme to your activity in your AndroidManifest.xml like so:

<activity 
    android:theme="@style/SolidWhiteTheme"
    ...
    >

    ...
</activity>
于 2014-10-07T23:01:00.697 回答
0

Try specifying a background color for your activity (android:background). If the background is not explicitly set, the device may be using it's own device-specific default background, which is why the gradient is only shown on your Nexus 4 and not other devices.

于 2014-10-07T22:56:32.177 回答
0

As Denley mentioned, the reason for this is the default background specified by the Holo.Light theme. However, since this background is specifically affecting your ListView, I would suggest setting the background of your ListView in your xml file. Code below.

<ListView
    android:background="@android:color/white">
于 2014-10-13T17:30:37.413 回答