If you're wracking your brain trying to figure out why that ImageView isn't displaying the drawable (and you know the drawable's there), make sure and check that you have specified the namespace prefix for the "src" attribute.
Android will silently ignore an attribute like src="@drawable/image_I_know_exists", when you really need to be specifying android:src="@drawable/image_I_know_exists", assuming you've got something like this defined previously in your XML: xmlns:android="http://schemas.android.com/apk/res/android"
To recap:
Image will NOT show (but no error messages or anything):
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
src="@drawable/image_I_know_exists"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
Image WILL show:
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/image_I_know_exists"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
Yes, that's a bit of clutter. I know folks rant against the layout approach in Android, but it is really convenient when you really need to get under the hood, but that's another story.
In search of the Ahh and Aha via Data Visualization.
bradflyon@gmail.com
A Summary of My Visualizations
Showing posts with label src. Show all posts
Showing posts with label src. Show all posts
Subscribe to:
Posts (Atom)
Popular Posts
-
The purpose of this page is to summarize in one place some of the interactive visualizations I have worked on. Most of these were built...
-
Note: I have extended this to a visualization for the entire world, which is on googledrive here . Recently, I was wondering how what it ...