I have photo album which shows the image as rounded with white border. Image will be adding dynamically. I tried frame layout but it it not working for me. My try : Adding dynamic image over already existing round shape image..
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/image"
android:layout_width="60dip"
android:layout_height="60dip"
android:adjustViewBounds="true"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/imagef"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/ph_bg" />
</FrameLayout>
Above xml not giving exact result .. any idea ?
Use below xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/image"
android:layout_width="60dip"
android:layout_height="60dip"
android:adjustViewBounds="true"
android:layout_centerInParent="true"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/imagef"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:background="@drawable/ph_bg" />
</RelativeLayout>
This will do your task.
Happy coding :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With