fileListView = new FileListController(this);
fileListView.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
pWindow.dismiss();
}
});
pWindow = new PopupWindow(fileListView);
pWindow.setWindowLayoutMode(ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
pWindow.setTouchable(true);
button_show.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if (pWindow.isShowing()) {
pWindow.dismiss();
return;
}
pWindow.showAsDropDown(v);
pWindow.setFocusable(true);
pWindow.update();
}
});
fileListView.listView.setLongClickable(true);
registerForContextMenu(fileListView.listView);
答案 0 :(得分:0)
您必须明确设置宽度和高度。
pWindow.setHeight(100);
pWindow.setWidth(100);