首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

PopupWindow的施用

2012-09-03 
PopupWindow的使用View pview inflater.inflate(R.layout.popup_example,(ViewGroup)findViewById(R.lay

PopupWindow的使用

View pview = inflater.inflate(R.layout.popup_example,(ViewGroup)findViewById(R.layout.main));?
PopupWindow pw = new PopupWindow(pview);?
? ? ? ? ? ? pw.showAtLocation(v, Gravity.LEFT,0,0);?
? ? ? ? ? ? pw.update(8,-70,150,270);?
?
? ? ? ? ? ? ? //if onclick written here, it gives null pointer exception.?
? ? ? ? ? ? ImageButton img=(ImageButton)pview.findViewById(R.id.home);?
? ? ? ? ? ? img.setOnClickListener(new OnClickListener()?
? ? ? ? ? ? {?
? ? ? ? ? ? ? ? public void onClick(View v)?
? ? ? ? ? ? ? ? {?
? ? ? ? ? ? ? ? ? ? Intent.....?
? ? ? ? ? ? ? ? }?
? ? ? ? });?

热点排行