团队冲刺

第四天,今天完善匹配功能

重要函数:

 private void setDialog() {
Dialog mCameraDialog = new Dialog(this, R.style.BottomDialog);
RelativeLayout root = (RelativeLayout) LayoutInflater.from(this).inflate(
R.layout.bottom_dialog, null);
//初始化视图
root.findViewById(R.id.btn_1).setOnClickListener(this);
root.findViewById(R.id.btn_2).setOnClickListener(this);
root.findViewById(R.id.btn_3).setOnClickListener(this);
mCameraDialog.setContentView(root);
Window dialogWindow = mCameraDialog.getWindow();
dialogWindow.setGravity(Gravity.BOTTOM);
// dialogWindow.setWindowAnimations(R.style.dialogstyle); // 添加动画
WindowManager.LayoutParams lp = dialogWindow.getAttributes(); // 获取对话框当前的参数值
lp.x = 0; // 新位置X坐标
lp.y = 0; // 新位置Y坐标
lp.width = (int) getResources().getDisplayMetrics().widthPixels; // 宽度
root.measure(0, 0);
lp.height = root.getMeasuredHeight();

lp.alpha = 9f; // 透明度
dialogWindow.setAttributes(lp);
mCameraDialog.show();
}
}


参考文档:即时通讯 · Android – Bmob后端云
原文地址:https://www.cnblogs.com/D10304/p/14912439.html