Android 播放音乐时如何显示ProgressBar微调器?

Android 播放音乐时如何显示ProgressBar微调器?,android,progress-bar,Android,Progress Bar,我为我的应用程序创建了一个屁音板。我对开发非常陌生,这是我的第一个应用程序。我有一堆按钮,当使用onClick button\u sound.start方法单击时播放声音。如何仅在通过xml播放声音时显示旋转进度条?这是我的密码: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" and

我为我的应用程序创建了一个屁音板。我对开发非常陌生,这是我的第一个应用程序。我有一堆按钮,当使用onClick button\u sound.start方法单击时播放声音。如何仅在通过xml播放声音时显示旋转进度条?这是我的密码:

        <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:background="@raw/nuke" 
    android:padding="8dp">

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="Click a button to play a fart!"
    android:textColor="#FF0000"
    android:textSize="24dp" />
<SeekBar 
    android:id="@+id/sbVolume1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" />

<Button
    android:id="@+id/ranfart"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Random Fart"
    android:textColor="#0B0B61"
    android:textSize="21dp" />

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >    
<Button 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Fart 1"
    android:layout_weight="50"
    android:textSize="21dp"
    android:id="@+id/fart1"
    android:textColor="#0B0B61"/>
<Button 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Fart 2"
    android:layout_weight="50"
    android:textSize="21dp"
    android:id="@+id/fart2"
    android:textColor="#0B0B61"
    />
</LinearLayout>
</LinearLayout>
</ScrollView>

如何仅在声音播放期间制作旋转进度加载器?
还有,我如何使旋转进度条在我的按钮上?(不是在上面,不是在下面,而是在上面?

你想要一个ProgressBar还是SeekBar?听起来你想要一个ProgressBar,但你的XML中包含了一个SeekBar。无论如何,你应该通读一遍。它会帮助你在一件事情上显示另一件事情。至于只在播放声音时显示ProgressBar,它会如果你让我们看看你正在使用的一些代码,我会帮助大家。播放声音有不同的方式,因此实现你的目标有不同的方式。

我想要一个Progressbar。seekbar是我已经设置好的音量。我只需要知道如何在播放音乐时让Progressbar旋转。我不在我的电脑上compjter现在不能显示u代码,但我的java看起来是这样的:fart1.setonClickListener(new view.onclicklistener)…bla bla……和我有fart1.start();(我在java的前面将fart1设置为声音)