Android - 在相机中设置指南

Android - setting up guidelines in the camera

想知道有没有办法在相机的宽和长的中间分别加一条垂直和水平的黄线,让用户在拍照时有一个大概的指引。如果需要,我可以 post 编码。提前致谢。

此代码可能对您有帮助:

final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.guideline);
dialog.setCanceledOnTouchOutside(true);
//for dismissing anywhere you touch
View masterView = dialog.findViewById(R.id.guidelineView);
masterView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        dialog.dismiss();
    }
});
dialog.show();