在Android中更改ProgressBar fps
我在xml中使用在Android中更改ProgressBar fps,android,android-progressbar,Android,Android Progressbar,我在xml中使用ProgressBar,Android总线非常慢。最佳速度为60fps。是否可以更改帧速率或添加具有更多fps的自定义进度循环 <ProgressBar android:id="@+id/progressBar1" android:layout_width="wrap_content" android:layout_height="wrap_conten
ProgressBar
,Android总线非常慢。最佳速度为60fps。是否可以更改帧速率或添加具有更多fps的自定义进度循环
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="17dp"
android:layout_gravity="center" />
您可以通过以下方式修改持续时间:
android:indeterminateDuration=<duration in ms>
android:不确定性=
解决方案:添加图片并使用360º的动画旋转:
<ImageView
android:id="@+id/resultados_estado_carga_imagen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/cargador"
android:layout_gravity="center" />
...
final ImageView resultados_estado_carga_imagen = (ImageView) findViewById(R.id.resultados_estado_carga_imagen);
RotateAnimation anim = new RotateAnimation(360, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setInterpolator(new LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
anim.setDuration(700);
resultados_estado_carga_imagen.startAnimation(anim);
...
最终ImageView resultados_estado_carga_imagen=(ImageView)findViewById(R.id.resultados_estado_carga_imagen);
RotateAnimation anim=新的RotateAnimation(360,0,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);
anim.setInterpolator(新的LinearInterpolator());
anim.setRepeatCount(Animation.INFINITE);
动画设定持续时间(700);
结果开始成像(anim);
谢谢:)不行。如果你把某个值设得很低,比如50,会怎么样?(我从未使用过此属性)速度与50相同:(,请尝试以60fps:pHm的速度使用imageview和loop(动画旋转360º),很抱歉没有帮助:/