use*_*423 5 android android-layout android-framelayout
我有相册,图像显示为带有白色边框的圆形.图像将动态添加.我试过框架布局,但它不适合我.我的尝试:在现有的圆形图像上添加动态图像..
<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>
Run Code Online (Sandbox Code Playgroud)
以上xml没有给出确切的结果..任何想法?
使用下面的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>
Run Code Online (Sandbox Code Playgroud)
这将完成你的任务.
快乐编码:)
| 归档时间: |
|
| 查看次数: |
20403 次 |
| 最近记录: |