You need to have your own custom expandable List adapter. In the getGroupView<http://code.google.com/android/reference/android/widget/SimpleExpandableListAdapter.html#getGroupView%28int,%20boolean,%20android.view.View,%20android.view.ViewGroup%29>and getChildView<http://code.google.com/android/reference/android/widget/SimpleExpandableListAdapter.html#getChildView%28int,%20int,%20boolean,%20android.view.View,%20android.view.ViewGroup%29>. You need to specify the appropite image and text ...
On Mon, Dec 8, 2008 at 8:55 PM, androidian <[EMAIL PROTECTED]> wrote: > > Hmmm...this one wasn't as solved as I thought. When using a > SimpleExpandableListAdapter, you don't have easy access to the > TextViews inside it. It looks like I can specify my own layout file > to use for the individual rows, and set TextViews for use by the rows, > and I guess I could set the android:drawableRight attribute on these, > but how can this be dynamic? i.e. I need to draw a particular > drawable based on a data field of the particular row. Given that I > can't get access to the individual rows in the java code, how can I > set this image dynamically in XML? > > > On Dec 5, 2:41 pm, androidian <[EMAIL PROTECTED]> wrote: > > Thanks very much, very helpful !! > > > > On Dec 5, 1:31 pm, "for android" <[EMAIL PROTECTED]> wrote: > > > > > Sorry.. > > > > > textView. > > > > > > setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null); > > > On Fri, Dec 5, 2008 at 10:00 AM, for android <[EMAIL PROTECTED]> > wrote: > > > > > > > http://code.google.com/android/reference/android/widget/TextView.html...)< > http://code.google.com/android/reference/android/widget/TextView.html...> > > > > > > Add the image like this. in the appropriate position...Probable u > want it > > > > at the right,so use > > > > > > textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, > null, > > > > null); > > > > > > On Fri, Dec 5, 2008 at 5:48 AM, androidian <[EMAIL PROTECTED]> > wrote: > > > > > >> In the documentation for SimpleExpanderListAdapter (http:// > > > >> code.google.com/android/reference/android/widget/ > > > >>SimpleExpandableListAdapter.html< > http://code.google.com/android/reference/android/widget/SimpleExpanda...>) > > > >> it says that the views which > > > >> ultimately end up defining the display of the individual group and > > > >> child rows, must be TextViews. > > > > > >> I think I'm reading this right but I need some clarification...does > > > >> this mean that there's no way to put an image into these group and > > > >> child rows? e.g. let's say I want my own icon to sit to the right > of > > > >> the text in a row...can I do that in any way? > > > > > >> If not, could I do it by subclassing BaseExpandableListAdapter? Any > > > >> tips? > > > > > >> cheers, > > > >> Ian > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---

