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