首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android-完整利用AsyncTask兑现网络图片下载的实例

2012-06-29 
android-完整利用AsyncTask实现网络图片下载的实例先看看效果图:LinearLayout xmlns:androidhttp://sch

android-完整利用AsyncTask实现网络图片下载的实例

先看看效果图:

android-完整利用AsyncTask兑现网络图片下载的实例

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

? ? android:layout_width="fill_parent"

? ? android:layout_height="fill_parent"

? ? android:orientation="vertical" >

?

? ? <TextView

? ? ? ? android:layout_width="fill_parent"

? ? ? ? android:layout_height="wrap_content"

? ? ? ? android:text="一步下载图片"?

? ? ? ? android:id="@+id/txt"/>

?

? ? <Button

? ? ? ? android:id="@+id/downImg"

? ? ? ? android:layout_width="wrap_content"

? ? ? ? android:layout_height="wrap_content"

? ? ? ? android:text="开始下载图片" />

?

? ? <FrameLayout

? ? ? ? android:layout_width="match_parent"

? ? ? ? android:layout_height="wrap_content" >

?

? ? ? ? <ImageView

? ? ? ? ? ? android:id="@+id/imgView"

? ? ? ? ? ? android:layout_width="wrap_content"

? ? ? ? ? ? android:layout_height="wrap_content" />

?

? ? ? ? <ProgressBar

? ? ? ? ? ? android:id="@+id/progressBar"

? ? ? ? ? ? android:layout_width="fill_parent"

? ? ? ? ? ? style="?android:attr/progressBarStyleHorizontal"

? ? ? ? ? ? android:layout_height="wrap_content"

? ? ? ? ? ? android:layout_gravity="center"

? ? ? ? ? ? android:visibility="invisible"

? ? ? ? ? ? />

? ? </FrameLayout>

</LinearLayout>

?

?