Friday, December 16, 2011

Re: [android-developers] Are layouts no longer considered Drawables in Ice Cream Sand....?

Bitmaps are still drawable, but there's a bug in your code, you wrote:
@drawable/mybitmapdrawable.xml

It should be:
@drawable/mybitmapdrawable

On Fri, Dec 16, 2011 at 5:48 PM, Richard Schilling
<coderroadie@gmail.com> wrote:
> I've got this in my layout declaration in a file, let's call it
> mybitmapdrawable.xml:
>
>
> <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
>
>   android:src="@drawable/mygraphic"
>
>   android:tileMode="repeat"
>
> />
>
>
> mygraphic is a .png file.  Prior to 4.0 I don't see a problem with the
> resource being inflated into a drawable.  But on 4.0 and above when I have
> this definition in mylayout.xml:
>
>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
>
>     android:layout_width="fill_parent"
>
>     android:layout_height="fill_parent"
>
>     android:orientation="vertical"
>
>     android:background="@drawable/mybitmapdrawable.xml">
>
> </LinearyLayout>
>
>
> I get an error at android.res.Resources.loadDrawable(Resources.java:1899):
>
> 12-16 16:50:02.567: E/AndroidRuntime(1542): Caused by:
> android.content.res.Resources$NotFoundException: Resource is not a Drawable
> (color or path): TypedValue{t=0x1/d=0x7f020095 a=-1 r=0x7f020095}
>
>
>
> Did the interpretation of the <bitmap> tag change so it's no longer being
> inflated as a drawable, or is this a bug in the new platform?
>
>
> Thanks
>
>
> Richard
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
Romain Guy
Android framework engineer
romainguy@android.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate