MainActivity如下:

package com.example.ttt;import android.app.Activity;import android.app.ProgressDialog;import android.os.Bundle;import android.view.Window;/** * Demo描述: * 改变系统自带ProgressDialog的文字大小 *  * 改变方式: * 为ProgressDialog设置一个style即可 * 参见styles.xml * */public class MainActivity extends Activity {  @Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);    setContentView(R.layout.activity_main);    //为此ProgressDialog指定style    ProgressDialog dialog = new ProgressDialog(this,R.style.dialog);    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);    dialog.setCanceledOnTouchOutside(false);    dialog.setMessage("loading");    dialog.setCancelable(false);    dialog.show();      }  }

 

activity_main.xml如下:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    >    <TextView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:text="@string/hello_world"         android:layout_centerHorizontal="true"     />RelativeLayout>

styles.xml如下:

<resources xmlns:android="http://schemas.android.com/apk/res/android">       <style name="AppBaseTheme" parent="android:Theme.Light">           style>      <style name="AppTheme" parent="AppBaseTheme">    style>            <style name="dialog" parent="@android:style/Theme.Dialog">        @null        true        true        true        @android:color/transparent        true        @null        25sp    style>resources>

 原文  http://blog.csdn.net/lfdfhl/article/details/11032535

更多相关文章

  1. Android(安卓)设置全屏显示的方法
  2. Android(安卓)Java方法链起来!链式调用方法、仿Builder 等。
  3. Android简单短信发送示例
  4. android sdcard文件存储 + 媒体库更新方法
  5. Android从网上下载文件
  6. Android中系统设置参数改变监听(以时间同步为例)
  7. Android自学笔记之短信发送器
  8. Android(安卓)读写XML文件(使用pull解析)
  9. Android利用Looper在子线程中改变UI

随机推荐

  1. Android(安卓)任务和回退堆栈---管理任务
  2. 一次重拾Android(安卓)Studio开发的经历
  3. [原] Android持续优化 - 提高流畅度
  4. Android(安卓)UI 之CheckBox的妙用
  5. 【Android】Android的与服务器端传送信息
  6. android 中如何添加新的键值
  7. Android属性动画完全解析(下) Interpolat
  8. 【项目中】Android(安卓)小米红米手机无
  9. 嵌入式设备Android带来的奇迹
  10. Android(安卓)使用 Jenkins 实现自动化打