У меня есть 2 макета в моем xml, CircularImageView и ImageView, а ImageView должен появиться поверх CircularImageView.ImageView overlay не работает
Я пробовал:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_kids_register_ll_kid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/md_white_1000"
android:orientation="horizontal">
<RelativeLayout
android:padding="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.mikhaellopez.circularimageview.CircularImageView
android:id="@+id/fragment_kids_row_img_kids"
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@drawable/ic_boy"
/>
<ImageView
android:id="@+id/fragment_kids_row_iv_crown"
android:layout_toRightOf="@+id/fragment_kids_row_img_kids"
android:layout_marginLeft="-26dp"
android:layout_marginTop="-22dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:src="@drawable/ic_crown"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/fragment_kids_row_tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:textColor="@color/md_black_1000"
android:textSize="24sp" />
<TextView
android:id="@+id/fragment_kids_row_tv_age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="1 ano e 4 meses"
android:textColor="#808080"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
Мне нужно изображение, которое будет показано именно в таком положении в кадре, но не «обрезанные», что мне здесь не хватает?
BTW, этот компонент является частью строки RecyclerView.
EDIT --- Я забыл упомянуть, изображение является просто заполнителем, чтобы показать Аватар, но изображение динамически населено!
Спасибо!
Проблема заключается в отрицательных полях –
, вы можете поместить второе изображение в центр родителя (по горизонтали) и использовать положительные поля, чтобы компенсировать его там, где вы хотите, вместо того, чтобы поместить его вправо от другого представления и использовать отрицательные поля ... похоже, вы можете сохранить представление в соответствие с верхней частью родителя, так что вы можете оставить это в покое – kimchibooty