Solved this one after a bit more extensive research. In the event that
it aids in anyone's efforts, it seems as though it is
necessary to also include the <android:s...@drawable)> element in the
ImageView attribute in addition to the id. This worked:
<ImageView android:id="@+id/yellowbutton"
android:src="@drawable/yellowbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
On Nov 11, 12:14 pm, mirage4d <[email protected]> wrote:
> Hi all,
>
> My first post. Greetings.
>
> I'm toying around with the Notepad tutorial and adding some
> functionality. So far, I've successfully added a timestamp to the note
> which is subsequently displayed to the left of the note title in the
> listview after saving a new note. However, as you can see below, I'm
> attempting to load and display a small .png file in the row as the
> first element - no luck so far. It seems fairly straight forward from
> the few docs I have found. The resource (yellowbutton) is created and
> listed as a drawable in the R file after saving the image to the
> drawable folder, and everything compiles fine. However the image
> (yellowbutton) isn't displayed in the row. Perhaps ImageView isn't the
> class/attribute I should be using? Any insight would be greatly
> appreciated. Code is below. Thanks.
>
> <?xml version="1.0" encoding="utf-8"?>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
> android"
> android:orientation="horizontal"
> android:layout_width="fill_parent"
> android:layout_height="wrap_content">
>
> <ImageView android:id="@+id/yellowbutton"
> android:layout_width="wrap_content"
> android:layout_height="wrap_content"/>
>
> <TextView android:id="@+id/text1" xmlns:android="http://
> schemas.android.com/apk/res/android"
> android:textColor="#FFF0CC"
> android:textStyle="bold"
> android:layout_width="wrap_content"
> android:layout_height="wrap_content"
> android:layout_weight="1"/>
>
> <TextView android:id="@+id/date" xmlns:android="http://
> schemas.android.com/apk/res/android"
> android:textColor="#FFF0CC"
> android:textStyle="italic"
> android:gravity="right"
> android:layout_marginLeft="40px"
> android:layout_width="wrap_content"
> android:layout_height="wrap_content"
> android:layout_weight="1"/>
>
> </LinearLayout>
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en