【发布时间】:2014-08-29 21:28:06
【问题描述】:
我想在 imageView 上显示进度条。如果我这样做,通常效果很好:
<RelativeLayout
android:id="@+id/image_holder"
android:layout_width="120dip"
android:layout_height="120dip"
android:layout_gravity="center"
android:layout_marginLeft="16dip"
android:layout_marginRight="16dip"
android:layout_marginTop="22dip" >
<ImageView
android:id="@+id/im_photo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ProgressBar
android:id="@+id/progressbar1"
android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="match_parent" />
</RelativeLayout>
是否可以将其组合成单个小部件?
【问题讨论】:
-
是的,通过扩展RelativeLayout来创建一个自定义布局类
标签: android