Closed. This question needs to be more focused。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?更新问题,使其仅通过editing this post专注于一个问题。
                        
                        3年前关闭。
                                                                                            
                
        
我想知道是否有办法在相机的宽度和长度中间分别添加一条垂直的和水平的黄线,以便用户在制作照片时有一个粗略的指导原则。如果需要,我可以发布代码。提前致谢。

最佳答案

此代码可以帮助您:

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();

关于java - Android-在相机中设置准则,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/27751500/

10-10 09:37