Android 动态添加控件

来源:互联网 发布:淘宝怎么开通微淘 编辑:程序博客网 时间:2024/05/16 12:22

 相机源码中 VideoCamera.java:


ViewGroup rootView = (ViewGroup) findViewById(R.id.video_camera);
        LayoutInflater inflater = this.getLayoutInflater();


View controlBar = inflater.inflate(
                    R.layout.attach_camera_control, rootView);
            controlBar.findViewById(R.id.btn_cancel).setOnClickListener(this);
            ImageView retake =
                    (ImageView) controlBar.findViewById(R.id.btn_retake);

原创粉丝点击