2F03-view-progress-indeterminate-in-title-bar

介绍在在title bar上显示indeterminate progress

/*
 * Copyright (C) 2007 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.example.android.apis.view;

import com.example.android.apis.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.View;
import android.widget.Button;

/**
 * Demonstrates how to use an indeterminate progress indicator in the window's title bar.
 */
public class ProgressBar4 extends Activity {
    private boolean mToggleIndeterminate = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Request progress bar
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        setContentView(R.layout.progressbar_4);
        setProgressBarIndeterminateVisibility(mToggleIndeterminate);

        Button button = (Button) findViewById(R.id.toggle);
        button.setOnClickListener(new Button.OnClickListener() {
            public void onClick(View v) {
                mToggleIndeterminate = !mToggleIndeterminate;
                setProgressBarIndeterminateVisibility(mToggleIndeterminate);
            }
        });
    }
}

2F03-view-progress-indeterminate-in-title-bar,布布扣,bubuko.com

时间: 2024-11-08 21:13:06

2F03-view-progress-indeterminate-in-title-bar的相关文章

如何隐藏android的屏幕上的Title Bar

1. 在Activity中的onCreate方法中加入如下代码: //Remove title bar this.requestWindowFeature(Window.FEATURE_NO_TITLE); //Remove notification bar this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); //set

去掉android的屏幕上的title bar

在进行android开发时,每个Activity会默认带上一个title bar用以显示程序名,有时为了扩大屏幕的显示区域需要去掉这个title bar,去掉屏幕上的title bar有3个方法, 第一个方法是在代码去掉title bar 在Activity的onCreate中加入如下代码: Java代码   this.requestWindowFeature(Window.FEATURE_NO_TITLE); 但是使用这种方法,是在Activity将要显示的时候,仍然会出现title bar,

Android 去掉title bar的3个方法

1. Java代码实现 @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); //... } 留意这语句所在的位置的,似乎所有requestWindowFeature的操作都要放在setContentVie

Android开发之去掉title bar

去掉屏幕上的title bar有3个方法: 1.java代码实现: 1 @Override 2 publicvoid onCreate(Bundle savedInstanceState) { 3 super.onCreate(savedInstanceState); 4 5 requestWindowFeature(Window.FEATURE_NO_TITLE); 6 7 setContentView(R.layout.main); 8 //... 9 } 2.自定义style配置文件 在\

[UE4]Window Title Bar Area

一.Window Title Bar Area.windows窗口拖拽控件 二.window Buttons Enabled,在控件的右上角显示:最小化.最大化,关闭按钮; Toggle Fullscreen:双击Window Title Bar Area的区域可以最大化窗口 二.勾选了window Buttons Enabled选项. 三.勾选Toggle Fullscreen选项,只有在New Editor Window(PIE)运行模式起作用.实际游戏中也应该起作用. 原文地址:https

[Mac] How do I move a window whose title bar is off-screen?

有时窗口一不小心拖出视野外了,此时无法移动窗口.如何还原? 有人遇到相似问题,已有解决方法: 方法就是,菜单 Windows - Zoom  这时窗口会还原.

iOS开发UI篇— View controller-based status bar appearance

info.plist文件中,View controller-based status bar appearance项设为YES,则View controller对status bar的设置优先级高于application的设置.为NO则以application的设置为准,view controller的prefersStatusBarHidden方法无效,是根本不会被调用的. 一.如果View controller-based status bar appearance 设为YES. 这时 vi

outdated: 21.Lines, Antialiasing, Timing, Ortho View And Simple Sounds

这是一个简单的小游戏,类型相当于amidar,不过也有1000行,手困眼花......UP\DOWN\LEFT\RIGHT控制,SPACE重新开始. 在TimerInit()函数中,QueryPerformanceFrequency()函数查询性能计数器的频率.QueryPerformanceCounter()函数查询性能计数器的当前值.两个函数的参数都用到了LARGE_INTEGER的强制转换.以前写过一篇介绍的文章. 在glPrint()函数里,新添了glScalef()函数(用缩放矩阵乘以

Android之Action Bar

Action Bar在实际应用中,很好地为用户提供了导航,窗口位置标识,操作点击等功能.它出现于Android3.0(API 11)之后的版本中,在2.1之后的版本中也可以使用. 添加与隐藏Action Bar 在3.0之后的版本中(android:minSdkVersion 或者 android:targetSdkVersion 属性被设置成11或者更高),默认在activity中添加了Action Bar,不用额外添加.如果不想在activity中使用Action Bar,我们可以通过设定a

【IOS笔记】Creating Custom Content View Controllers

Creating Custom Content View Controllers 自定义内容视图控制器 Custom content view controllers are the heart of your app. You use them to present your app’s unique content. All apps need at least one custom content view controller. Complex apps divide the workl