2014-04-24 2 views
2

팝업 창 내에서 listview를 사용 중이며 listview에 일부 동적 내용이 표시됩니다. 내용을 기반으로 listview의 높이를 설정하고 싶지만 특정 높이를 초과해서는 안됩니다. 그 listview의 최대 높이를 설정할 수 없기 때문에 listview의 높이를 어댑터 getview에서 변경하고 배치에서 wrapcontent를 사용했습니다. . 콘텐츠 크기가 커지면 목록보기 높이가 변경됩니다. 그러나 콘텐츠 크기가 감소하는 동안 크기는 변하지 않습니다.팝업 창 높이 내의 목록보기가 변경되지 않습니다.

if(co_get>11) 
{    
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, 600); 
    params.setMargins(10, 10, 10, 10);  
    parent.setLayoutParams(params); 

} 
else 
{   
     LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT); 
     params.setMargins(10, 10, 10, 10);   
     parent.setLayoutParams(params); 

} 

그리고 이것은 내가 getview에서 사용한 코드입니다.

답변

2

내가 통지 될 때 Layoutparams를 listview로 설정했습니다. 그리고 그 문제가 해결되었습니다.

0

대화 상자가 표시 될 때마다 onPrepareDialog() 메서드가 호출되므로 적절하게 업데이트 할 수 있습니다.

@Override 
protected void onPrepareDialog(int id, Dialog dialog) { 
    //Always call through to super implementation 
    // your changings 
} 
+0

나는 대화 상자가 아닌 PopupWindow를 사용하고 있습니다. – Anu

+0

오, 미안) ..... –