views:

100

answers:

1

I'm building a dialog class which inherits from Dialog, and all internal UI is programmatic. It's structured in the following way:

Dialog
+LinearLayout
++TextView
++ScrollView
+++LinearLayout
++++ListView

Unfortunately, when I show() the Dialog, it's too short. I'd like it to maximize and cover as much of the screen as possible, but only when there are enough items in the ListView to warrant it.

I haven't found my answer in the docs, and I haven't been able to get it to work by setting WRAP_CONTENT as layout parameters, or setting heights manually.

What is the proper way to approach this?

Thanks, Sean

A: 

Ok, nevermind. After reading some posts on ScrollView, saw that ListView actually has scrolling capabilities itself. The following works just great:

Dialog
+LinearLayout
++TextView
++ListView (will start scrolling automatically when dialog gets too tall)

Sean