怎样在标题栏中显示进度条

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//调用窗口有特征,启用标题栏中的进度条
requestWindowFeature(Window.FEATURE_PROGRESS); //显示进度的进度条
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);//不显示进度的模糊进度条

setContentView(R.layout.activity_main);
setProgress(500);//设置进度条的进度
setProgressBarIndeterminateVisibility(true);//设置模糊进度条是否可见
}
}

我的android学习经历19-LMLPHP

05-11 22:19
查看更多