Hi!

On one of my screens I want to have a list with only one item and I
want to declare the item in XML since that's easier than writing a
separate adapter . So i tried doing it without a ListView like in
"Code 1". The problem then is that selection isn't working like in the
listview. I can't select the one "row" inside the linearlayout.

So is there a way to declare the items in the listview directly in the
XML? My screen looks like this:

<label>
<textview1> <textview 2>

<label>
 <image1> <image2><image3>

And I want the user to be able to select the textviews or the images.
Hope this was understandable :-)

It's somewhat similar to the question asked here:
http://www.mail-archive.com/android-developers@googlegroups.com/msg01647.html

But the answer was "do it in code"... so does the same apply here?

-Christer


Code 1
<LinearLayout
                  xmlns:android="http://schemas.android.com/apk/res/android";
                        android:orientation="horizontal"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="right"
                        android:layout_gravity="right"
                        android:id="@+id/score_parent_layout">
                        <TextView
                          android:id="@+id/score_home"
                          android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:gravity="right"
                                android:layout_gravity="right"
                                style="@style/LiveLineText"
                                android:layout_marginLeft="4px"
                                android:text="4">
                        </TextView>
                        <TextView android:id="@+id/score_separator"
                                android:layout_width="wrap_content"
android:layout_height="wrap_content"
                                android:gravity="right" 
android:layout_gravity="right"
android:text=" - "
                                style="@style/LiveLineText">
                        </TextView>
                        <TextView android:id="@+id/score_away"
android:layout_width="fill_parent"
                                android:layout_height="wrap_content" 
android:text="1"
                                android:gravity="right" 
android:layout_gravity="right"
                                android:paddingRight="8px" 
style="@style/LiveLineText">
                        </TextView>

                </LinearLayout>
--~--~---------~--~----~------------~-------~--~----~
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-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to