当前位置:编程学习 > wap >>

popupWindow 监听事件

private void showView(Context mContext) {
LayoutInflater mLayoutInflater = (LayoutInflater) mContext
.getSystemService(LAYOUT_INFLATER_SERVICE);
View music_popunwindwow = mLayoutInflater.inflate(
R.layout.music_popwindow, null);
mPopupWindow = new PopupWindow(music_popunwindwow,
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
mPopupWindow.showAtLocation(findViewById(R.id.mainn), Gravity.RIGHT
| Gravity.BOTTOM, 0, 44);
}
现在我这个弹出窗口里面是5个linearLayout  想监听linearLayout点击触发事件  该怎么做?  新手不会 求指教 --------------------编程问答-------------------- music_popunwindwow.findViewById(...)
setOnClickListener() --------------------编程问答--------------------
引用 1 楼 fylz1125 的回复:
music_popunwindwow.findViewById(...)
setOnClickListener()


+1,补充一下,5个LinearLayout要设置对应的ID,同时,如果出现事件覆盖的情况就做个事件冒泡处理。
补充:移动开发 ,  Android
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,