如何将带有Java代码的videoview添加到xml文件?
最佳答案
这是我在您的xml布局中使用RelativeLayout
的代码,
RelativeLayout layout = (RelativeLayout) findViewById(R.id.layout);
VideoView video = new VideoView(this);
video.setVideoURI("yourURI");
video.setLayoutParams(new FrameLayout.LayoutParams(550, 550));
layout.addView(video);
随便给我喂一些对你来说不明显的东西