setting max height of listview with initial height is wrap content(it may be empty)

by jalandar » Tue, 13 Jan 2009 20:50:32 GMT


Sponsored Links
 Hello everybody I want set initial height of list view with wrap
content, and later it will be expanded as per data added to specific
limit of height. I used wrap_content for height and android:maxHeight
="100px", but it is not working properly the list grows in height
beyond the maxHeight as the list item added.
Is there any other solution.
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Change backround of the view embedded in the ListView item

I have a ListView backed by customized ArrayAdapter where each item
has 2 LinearLayouts - one I call head, and the other one - body. The
body is hidden (gone) until user clicks on the row at which time it
slides out. The second click (on the head) will hide the body. However
if user clicks on the body it brings another activity. All of this
works just fine, here comes the problem:

When user presses on body I want a visual indication of the action
just the same way as regular list item will flicker an orange
background when pressed. I'm not getting this by default since (my
theory) the onPress event is intercepted by body's view and not
processed by the list item.

The first thing I tried was to execute body.setBackground('#ff00ff')
(never mind the color) in onPress event. That didn't work since (I
suspect) there's no repainting after the call. Then I dig a little bit
more and decided to use <selector/>-based background. I defined
body_background.xml in drawable folder and assigned that to the body's
background property.

There I noticed that background will only change if the even is
processed by the list. For example if I set <item
android:state_selected="true" android:drawable="@drawable/selected"/>
then when I press on the head - the background of both elements (head
and body) will change, however when I press on body - nothing.

So to summarize my question - how do I change background of the child
element in the list item if I assign custom onClick handler to it? Any
hints will be greatly appreciated

--~--~---------~--~----~------------~-------~--~----~

2. help: how to compile iproute2 in android platform?

Hi
I want to use the tool 'ip' to do some advanced network configuration (such
as tunnel configurations and other operations) in Android/linux shell.   The
command 'ip' is packaged in iproute2 (
http://www.linuxfoundation.org/en/Net:Iproute2).  I am new to this area.
 Could anyone give me some hint that how to compile this tool in
Android/linux platform?

btw, I saw that by default, android has built many network tools such as
'tcpdump','iptables', etc. (with the source code in external/ directory).

Thanks in advance.  Any comments is appreciated.

Best

Hugo

--~--~---------~--~----~------------~-------~--~----~

3. Drawing on top of a camera preview

4. How android translate kernel input eve nts to userland input eventsé”›

5. access /dev/graphics/fb0 from JNI FAILED

6. Android activity as overlay over other app

7. Permission at installation time and run tim