Andrew wrote: > I have a question about the ListView. > > Example: > In a ListView, there are many items. If I press up/down key to select > one item, what I want is show a button on the selected view, and if > the selected item is unselected, the button will be hide. > > How can I change the layout when the item gets selected?
You might not be able to wholesale change the layout, but you can make widgets visible/invisible/gone via setVisibility(). A heavier approach would be to make each row in the list a ViewFlipper, or include a ViewFlipper, so that you can swap out a button-showing and a button-hiding view upon selection. I would think hiding a single button would be less resource-intensive than using a ViewFlipper, but I may be wrong. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 1.1 Published! --~--~---------~--~----~------------~-------~--~----~ 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] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

