I know of a couple ways to do this (neither of which I like) - so I'm turning to t开发者_运维技巧he experts at SOF.
I want to use the ProgressBar
. The catch is that I want to use this as the image/background for my ImageView
. Is there a way to do this? I started trying this with drawable
but I wasn't sure how to go about it exactly.
You can use a ViewSwitcher
to switch between the ImageView
and a ProgressBar
. You can set the ProgressBar
as the first child, and when you are done loading the image, you can switch to the ImageView
.
Use FrameAnimation drawable as the source of the ImageView or you can rotate it use TweenAnimation.
Animation Resource
<LinearLayout
android:orientation="horizontal"
... >
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@android:style/Widget.ProgressBar.Small"
android:layout_marginRight="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/loading" />
</LinearLayout>
精彩评论