【发布时间】:2018-11-19 10:58:43
【问题描述】:
如您所见here 我尝试为我的 FrameLayout 制作圆角。 这是我的 rounded_shape.xml 形状:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
<stroke android:width="@dimen/margin"
android:color="@color/colorBackground"/>
<corners android:radius="24dp" />
</shape>
看起来是这样的: rounded_shape.xml Preview
当我在我的代码中这样做时: frameLayout.setBackground(new BitmapDrawable(getResources(), bitmapPhoto.bitmap)); frameLayout.setForeground(getResources().getDrawable(R.drawable.rounded_shape)); 它看起来像这样: result on app
您可以通过圆角看到黑色边缘。
我怎样才能做出这样的形状: where the the edges are rounded and the black parts are gone already
【问题讨论】:
标签: android imageview android-imageview rounded-corners android-framelayout