对于我的Android应用程序, 我想在一个中放置一张图片。
期望的设计如下:
有没有关于如何实现这个功能的想法?
Create the animation xml :
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/progress_bar"
android:pivotX="50%"
android:pivotY="50%" />
Set the following to your progressbar view in layout xml:
android:indeterminateDrawable="@animator/progressbar_animation"
<?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"
android:gravity="center"
android:clickable="false">
<ProgressBar
android:id="@+id/progressBar1"
style="@android:style/Widget.ProgressBar.Small.Inverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:layout_centerInParent="true"
android:padding="30dp"
android:clickable="false"/>
<ImageView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/img"
android:clickable="false"/>
</RelativeLayout>
根据您的设计进行微调。
现在将此布局用作您的进度对话框可绘制对象。