luoj 2013-01-24
实现布局:imageview下藏着一个progressbar,当imageview没有加载完成时,会显示一个progressbar,当imageivew加载完成后,就会自动的覆盖下面的progressbar
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/shape_border" android:orientation="vertical" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <ProgressBar android:id="@+id/progressBar1" style="?android:attr/progressBarStyleSmall" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_marginLeft="97dp" /> <ImageView android:id="@+id/image" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/edit_padding" android:adjustViewBounds="true" android:scaleType="centerCrop" /> </RelativeLayout> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" > <TextView android:id="@+id/tv_cn_name" style="@style/details_text_style" android:text="餐厅名称" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" > <TextView style="@style/details_text_style" android:text="赞" /> </LinearLayout> </RelativeLayout> </LinearLayout> </LinearLayout>