2017-04-12 188 views
-1

我正在使用ListPopupWindow並希望爲其添加底部陰影。以下是我的代碼 -底部陰影到ListPopupWindow android

listPopupWindow = new ListPopupWindow(getApplicationContext()); 
    listPopupWindow.setContentWidth(500); 
    listPopupWindow.setDropDownGravity(Gravity.CENTER | Gravity.RIGHT); 
    listPopupWindow.setSelection(mSelectedPos); 
    listPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() { 
     @Override 
     public void onDismiss() { 
      listPopupWindow.dismiss(); 
     } 
    }); 
    Listpopupadapter adapter = new Listpopupadapter(mContext, mGameSortList, GameName, mFilterStr,mListener,Gravity.RIGHT); 
    listPopupWindow.setAdapter(adapter); 
    listPopupWindow.setAnchorView(mRightTV); 
    listPopupWindow.setForceIgnoreOutsideTouch(true); 
    listPopupWindow.show(); 

如何在顯示彈出窗口時顯示底部陰影。

TIA

+0

參考這其中也http://stackoverflow.com/questions/21211870/android-view-shadow –

回答

1
listPopupWindow.setBackgroundDrawable(new ColorDrawable(Color.BLACK)); 
+1

小描述OD的解決方案可以幫助瞭解問題背後的概念。 –