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如何設置顏色名稱「綠色」的顏色。如果我收到藍色,那麼它應該設置爲藍色 –