1

I an trying to display a PopWindow(whose height is to WRAP_CONTENT),which has a ListView inside it.If the content of list is more then popup window is not displayed at the exact position.

created Popup window:

mPopUp = new PopupWindow(mLayOut,popUpWidth ,
                WindowManager.LayoutParams.WRAP_CONTENT, true);

show at Location:

mPopUp.showAtLocation(mLayOut, Gravity.NO_GRAVITY, xPos, yPos);

I have attached the screenshots

i)When Button One is clicked it works fine When Button One is clicked

ii) when button two is selected,Y position got changed to the top of the screen when button two is selected

Ads
  • 6,681
  • 12
  • 47
  • 72
  • give your list a static height in `dip` – waqaslam Jan 23 '12 at 10:19
  • if static height is specified,less number elements is list will have empty spaces.But i don't want those empty space to be shown. – Ads Jan 23 '12 at 10:32
  • http://stackoverflow.com/questions/5487552/limit-height-of-listview-on-android define `weight` for the element enclosing listview – waqaslam Jan 23 '12 at 10:35
  • Only thing i was able to achieve was to change the height of the List view when it exceeds the screen size by overriding onMeasure(). Let me know is there any other solution. – Ads Jan 24 '12 at 08:20

0 Answers0