我在菜单中显示了一个进度旋转器。我想在旋转器内部显示一个数字,应该如何实现?以下是我正在执行的一些代码片段,以使进度旋转器正常工作:
public void onCreateOptionsMenu(...) {
...
if (uploadCount > 0) {
MenuItem updatingMenuItem = menu.findItem(R.id.photo_capture_action_updating);
updatingMenuItem.setActionView(R.layout.action_progressbar);
updatingMenuItem.expandActionView();
} else {
menu.removeItem(R.id.photo_capture_action_updating);
}
}
以下是 action_progressbar.xml。
<?xml version="1.0" encoding="utf-8"?>
<ProgressBar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</ProgressBar>
谢谢您,