Android Dialog下部ポップアップ
6147 ワード
、
xmlファイル
カスタムポップアップスタイル
if (dialShareDialog == null) {
dialShareDialog = new Dialog(context, R.style.dialog);
dialShareDialog.setContentView(R.layout.dialog_share);
dialShareDialog.setCanceledOnTouchOutside(true);
// ,
WindowManager.LayoutParams lp=dialShareDialog.getWindow().getAttributes();
lp.dimAmount=0.7f;
dialShareDialog.getWindow().getDecorView().setPadding(0, 0, 0, 0);
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
dialShareDialog.getWindow().setGravity(Gravity.BOTTOM);
}
ImageView weixinIv = (ImageView) dialShareDialog.findViewById(R.id.share_weixin_iv);
ImageView friendIv = (ImageView) dialShareDialog.findViewById(R.id.share_friend_iv);
ImageView kongjianIv = (ImageView) dialShareDialog.findViewById(R.id.share_kongjian_iv);
ImageView sinaIv = (ImageView) dialShareDialog.findViewById(R.id.share_sina_iv);
weixinIv.setOnClickListener(shareOnClickListener);
friendIv.setOnClickListener(shareOnClickListener);
kongjianIv.setOnClickListener(shareOnClickListener);
sinaIv.setOnClickListener(shareOnClickListener);
dialShareDialog.show();
xmlファイル
カスタムポップアップスタイル