0
我想在运行时用颜色设置表面视图边框。我做这样的,但它不工作没有设置颜色的表面视图边框
//Video View to play the vidoes ads.
surfaceView = new SurfaceView(context);
GradientDrawable drawable = new GradientDrawable();
drawable.setShape(GradientDrawable.RECTANGLE);
drawable.setStroke(5, Color.MAGENTA);
surfaceView.setBackgroundDrawable(drawable);
surfaceView.setPadding(10, 10, 10, 10);
当我设置这个视频随后停止显示。
请帮我让它正常工作。
在此先感谢
可以动态地设置的背景颜色,并给予余量图像 –
赞image.setPadding(2,2,2,2); image.setBackgroundColor(Color.WHITE); –
@YogeshTatwal如何设置颜色名称“绿色”的颜色。如果我收到蓝色,那么它应该设置为蓝色 –