android下拉菜单(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-02-18 03:21 点击:次
listView = (ListView) loginwindow.findViewById(R.id.popupwindow_pulldown_list);
pullListAdapter = new PullDownListAdapter(activity, data);
listView.setAdapter(pullListAdapter);
selectPopupWindow = new PopupWindow(loginwindow, width,LayoutParams.WRAP_CONTENT, true);
selectPopupWindow.setOutsideTouchable(true);
selectPopupWindow.setBackgroundDrawable(new BitmapDrawable());
// popupWindow.setAnimationStyle(R.style.MenuAnimation);
listView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
setSelected((String) data.get(arg2).get("textView"));
selectPopupWindow.dismiss();
}
});
}
/**
* 显示PopupWindow窗口
*
* @param popupwindow
*/
public void popupWindwShowing() {
selectPopupWindow.showAtLocation(parentView, Gravity.NO_GRAVITY, location[0], location[1] + height);
}
/**
* PopupWindow消失
*/
public void dismiss(){
selectPopupWindow.dismiss();
}
public void setOnDeleteData(DeleteData _deleteData){
deleteData = _deleteData;
}
public void setOnSelected(DeleteData _deleteData){
deleteData = _deleteData;
}
private void setSelected(String selectedItem){
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>