我想这样创建ImageView(图像的右侧):
我在CardView布局中使用它,因此我在卡片上有圆角,但是我需要单独创建图像的左下角(或右上角)。
我尝试了几种选择,但没有正常工作。
我该怎么做?你有小费吗?
这个简单的可绘制资源文件
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#fff"/>
<corners android:bottomLeftRadius="30dp" android:topRightRadius="30dp"/>
</shape>
并将绘图文件设置为背景图像视图
<ImageView
android:id="@+id/imageView"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/herenamedrawableresourcefile"
android:layout_gravity="center_horizontal"
android:src="@drawable/text_logo_fix" />
或您可以这样设置
<LinearLayout
android:padding="10dp"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/herenamedrawableresourcefile">
<ImageView
android:id="@+id/imageView"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
android:src="@drawable/text_logo_fix" />
</LinearLayout>