Android ProgressBar 显示在Title上面



package shortcut.song.com.myapplication;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;

public class TitleProgressBarActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_PROGRESS);
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

        setContentView(R.layout.activity_title_progress_bar);

    }

    public void showProgress(View view)
    {
        setProgressBarIndeterminateVisibility(true);
        setProgressBarVisibility(true);
        setProgress(200);

    }

    public void hideProgress(View view)
    {
        setProgressBarIndeterminateVisibility(false);
        setProgressBarVisibility(false);
    }
}

你可能感兴趣的:(Android)