2
我希望我的GridLayout
具有像下图中的3 Buttons
那样的圆角。这是否需要与视图的四舍五入等不同的代码,例如Buttons
,TextViews
等?布局上的圆角
gameplayGL.setBackgroundResource(R.drawable.roundedcorners);
gameplayGL.setBackgroundColor(Color.BLUE);
gameplayGL.getBackground().setAlpha(35);
roundedcorners.xml
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:bottomLeftRadius="8dp"
android:bottomRightRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp" />
</shape>
我试过我贴的代码吗?是的,它提供了我张贴的图像的输出。注意围绕3个按钮的布局没有圆角。 – Matt