Dror
Dror

Reputation: 2588

ImageView is black on Motorola Defy

I got a weird issue going on with a Motorola Defy Plus device.

I got a simple layout with a TabHost that contains an ImageView as a background image for all the tabs inside it.

For some odd reason, specifically on the Motorola Defy the ImageView appears black! But on all the other devices I tested it upon it worked great! (Samsung Galaxy SII, Galaxy Mini, Nexus 7)

The image is a regular .jpg files that weighs 102KB and its size is 1330X1774. It resides inside the res\drawable folder. Its name is - "blurtest_cropped2.jpg"

The .xml layout file is as follows -

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ImageView
            android:id ="@+id/main_background_imageview" 
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:src="@drawable/blurtest_cropped2"
            android:scaleType="centerCrop"
            />
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
        <!--  Required for TabWidget -->
        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    </LinearLayout>
</TabHost>

Thanks!

Upvotes: 1

Views: 635

Answers (1)

Mikey
Mikey

Reputation: 56

It's possible that the image resolution is too high for the Motorola Defy. If you don't want to reduce the resolution for the other devices, simply put the lower res image in drawable folder targeted for smaller/low density screens.

I had a similar issue just recently on my Huawei Ideos X5. I had 2 ImageViews on the same screen, one was fine, the other was black. I noticed that the defiant image's resolution was significantly higher than the others. After lowering the resolution of said image, sure enough, the defiant image will defy me no longer.

*Sorry, I'm enjoying using the word 'Defy' a little too much.

Upvotes: 4

Related Questions