loading android
drawal/loading.xml
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate android:drawable="@drawable/share_popout_icon_loading" android:pivotX="50.0%" android:pivotY="50.0%"
xmlns:android="http://schemas.android.com/apk/res/android" />
、、-------------------------------------------------------------
总觉的自带的progressdialog很丑,所以为了让自己看着舒服一些,不得以就得自己定义样式了,自定义Progressdialog其实很简单,一个layout文件,一个shape文件
再来,然后再有一个资源文件就可以了。
一下是代码
自定义Progressdialog布局文件
- <?xml version="1.0" encoding="utf-8"?>
- <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/bg_dialog_shape"
- android:gravity="center" >
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:gravity="center_horizontal"
- android:orientation="vertical" >
- <ProgressBar
- android:id="@+id/oahprogressbar"
- style="@android:style/Widget.ProgressBar.Small"
- android:layout_width="30dip"
- android:layout_height="30dip"
- android:indeterminateDrawable="@drawable/progress" />
- <TextView
- android:id="@+id/oaprogresstitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="20dip"
- android:gravity="center_vertical"
- android:text="正在验证..."
- android:textColor="@color/white" />
- </LinearLayout>
- </FrameLayout>
ProgressBar
- indeterminateDrawable的属性
- <?xml version="1.0" encoding="utf-8"?>
- <rotate xmlns:android="http://schemas.android.com/apk/res/android" >
- <rotate xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/loading" <!--这就是一张图片,不需要每一个状态一张图片-->
- android:pivotX="50%"
- android:pivotY="50%" />
- </rotate>
重写ProgressDialog ,
- package com.zl.dialog.view;
- import com.zl.payslip.R;
- import android.app.Dialog;
- import android.app.ProgressDialog;
- import android.content.Context;
- import android.os.Bundle;
- /**
- * @author gqs
- * @version 创建时间:2012-11-23 上午10:59:43
- * 类说明
- */
- public class MyDialog extends ProgressDialog{
- public PaySlipDialog(Context context, int theme) {
- super(context, theme);
- // TODO dvsdfads
- }
- public PaySlipDialog(Context context) {
- super(context);
- // TODO sdfsdf
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- // TODO Auto-generated method stub
- super.onCreate(savedInstanceState);
- // progressDialog.setIndeterminate(true);
- setCancelable(false);
- //progressDialog.show()
- setContentView(R.layout.progressdialog_layout);
- }
- public void showDialog()
- {
- show();
- }
- }

最后在Acivity里面直接调用就行了
public void showDialog(Context context)
{
MyDialog dialog = new MyDialog(context);
dialog.showDialog();
}
loading android的更多相关文章
- Android 一个绚丽的loading动效分析与实现!
http://blog.csdn.net/tianjian4592/article/details/44538605 前两天我们这边的头儿给我说,有个 gif 动效很不错,可以考虑用来做项目里的loa ...
- android动画介绍--Animation 实现loading动画效果
Animation的使用方法并不难.这里简单的介绍一下使用方法. 先看效果图: 效果还是不错的吧. 下面来看看使用方法. 动画效果是通过Animation来实现的,一共有四种,分别为: AlphaAn ...
- Android 网络加载通用Loading
为了用户体验用好,App在网络请求时通常都会显示个进度显示圈圈,提示用户耐心等待,最脍炙人口的莫过于登录啦. 接下来我们就通过Dialog来实现,然后在BaseActivity,BaseFragmen ...
- android 瀑布流
我们还是来看一款示例: 看起来很像我们的gridview吧,不过又不像,因为item大小不固定的,看起来是不是别有一番风味,确实如此.就如我们的方角图形,斯通见惯后也就出现了圆角.下面我简单介绍下实现 ...
- Android Tips – 填坑手册
出于: androidChina http://www.androidchina.net/3595.html 学习 Android 至今,大大小小的坑没少踩,庆幸的是,在强大的搜索引擎与无私奉献的 ...
- android 图片进度条
png图片 代码 ImageView loading=getActivity().findViewById(R.id.pro_loading); LinearInterpolator lin = ne ...
- 一个绚丽的loading动效分析与实现!
最终效果如下 从效果上看,我们需要考虑以下几个问题: 1.叶子的随机产生: 2.叶子随着一条正余弦曲线移动: 3.叶子在移动的时候旋转,旋转方向随机,正时针或逆时针: 4.叶子遇到进度条,似乎是融合进 ...
- android瀑布流效果(仿蘑菇街)
Android 转载分享(10) 我们还是来看一款示例:(蘑菇街) 看起来很像我们的gridview吧,不过又不像,因为item大小不固定的,看起来是不是别有一番风味,确实如此. ...
- Android开源框架ImageLoader的完美例子
本文转载于:http://blog.csdn.net/wwj_748/article/details/10079311 2013年8月19日开源框架之Universal_Image_Loader学习 ...
随机推荐
- STM32与LPC系列ARM资源之比较
由于有周立公开发板的影响,LPC系列的开发板在工程师心目中一般是入门的最好型号之一.这次刚好有STM32的竞赛,正好将两者的资源进行比较一下(LPC系列以LPC213X为例). LPC213X包括LP ...
- Delphi通过调用COM对象实现更改桌面壁纸
从前我也是用SystemParametersInfo这API来改桌面壁纸的,问题多多,也不知道哪错了,就没深究下去.看了CSDN的帖子后,大彻大悟~~ 在XP下,SystemParam ...
- nexus 7 2013 驱动安装及root
驱动安装 Nexus 7 2013连接上电脑后,设备管理器显示新设备 nexus 7 待安装驱动(其实是MTP设备待安装驱动).去谷歌网站下载最新的USB驱动,version 8.0 的.与以前的版本 ...
- Go语言Eclipse开发环境配置-Windows
1.首先安装eclipse,选择一个适合的版本就好,解压即可 http://www.eclipse.org/downloads/ 2.下载go语言安装包 官网地址 :http://www.golang ...
- iterm快捷键及操作技巧(附Linux快捷键)
标签操作 新建标签:command + t 关闭标签:command + w 切换标签:command + 数字 command + 左右方向键 切换全屏:command + enter 查找:com ...
- MySQL优化GROUP BY-松散索引扫描与紧凑索引扫描
满足GROUP BY子句的最一般的方法是扫描整个表并创建一个新的临时表,表中每个组的所有行应为连续的,然后使用该临时表来找到组并应用累积函数(如果有).在某些情况中,MySQL能够做得更好,即通过索引 ...
- magento中取不同store中的产品数据
$products = Mage::getResourceModel('catalog/product_collection') ->setStoreId( ...
- php 获取汉字拼音首字母的函数
function getFirstChar($string){ if($string{0}>="A" and $string{0}<="z" )re ...
- UITableView进阶,cell刷新,界面返回 保持所选cell
1.cell 刷新 NSIndexPath *indexPath_1=[NSIndexPath indexPathForRow:1 inSection:0]; NSArray *indexArray= ...
- The Tips of Success(成功的建议)
1.Do one thing at a time,and do well. 2.Never forget to say "thanks". 3,Keep on going.Neve ...