I inflated a ListView as the contentView in a PopupWindow.
If I don’t set the width & height, I can’t see the PopupWindow.
If I set them like this:
setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
The layout is being set like “fill_parent”. Why?
The layout attributes of the ListView and ListView item are all set to “wrap_content”.
Any suggestion? Thanks.
Here’s the
SimpleListViewclass implementation. I know it’s inefficient and I’m pretty sure it contains errors, but it shows how to measure a width of a list view.I also recommend to read this article.