public class ZNtestResActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.detail_progress);
}
} detail_progress布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/detail_progress"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:gravity="center" > <ProgressBar
style="@style/progress_bar_style"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5.0dip"
android:text="@string/data_loading"
android:textColor="@color/text_gray"
android:textSize="16.0dip" /> </LinearLayout> 样式文件文件:
  <style name="progress_bar_style" parent="@android:style/Widget.ProgressBar">
<item name="android:indeterminateDrawable">@drawable/progress_bar</item>
  </style> //使用shape定义的progressbar的效果文件
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0.0"
android:pivotX="50.0%"
android:pivotY="50.0%"
android:toDegrees="360.0" > <shape
android:innerRadiusRatio="3.0"
android:shape="ring"
android:thicknessRatio="8.0"
android:useLevel="false" >
<gradient
android:centerColor="#ffffffff"
android:centerY="0.5"
android:endColor="#ff000000"
android:startColor="#ff000000"
android:type="sweep"
android:useLevel="false" />
</shape> </rotate>

运行效果:

Android中使用shape制作一个旋转的progressbar的更多相关文章

  1. Android中的Shape使用总结

    参考:http://www.cnblogs.com/gzggyy/archive/2013/05/17/3083218.html 在Android程序开发中,我们经常会去用到Shape这个东西去定义各 ...

  2. Android中使用shape来定义控件

    本文章转接于:http://kofi1122.blog.51cto.com/2815761/521605 Android中常常使用shape来定义控件的一些显示属性,今天看了一些shape的使用,对s ...

  3. Android中的shape

    在Android程序开发中,我们经常会去用到Shape这个东西去定义各种各样的形状,shape可以绘制矩形环形以及椭圆,所以只需要用椭圆即可,在使用的时候将控件比如imageview或textview ...

  4. Android中使用shape实现EditText圆角

    之前看到手机上的百度editText控件是圆角的就尝试做了一下,看了看相关的文章. 因为代码少,看看就知道了.所以下面我就直接贴上代码供大家参考,有其他的好方法记得分享哦~ 整个代码不涉及JAVA代码 ...

  5. android中自定义shape

    <shape> <!-- 实心 --> <solid android:color="#ff9d77"/> <!-- 渐变 --> & ...

  6. Swift 中使用 SwiftyJSON 制作一个比特币价格 APP

    Swift 中处理 JSON 数据有很多种方式,可以使用原生的 NSJSONSerialization,也可以使用很多第三方库.原生的 NSJSONSerialization 方式这篇文章中介绍过.这 ...

  7. (转)Android中的Shape使用总结

    http://blog.csdn.net/bear_huangzhen/article/details/24488337 在Android程序开发中,我们经常会去用到Shape这个东西去定义各种各样的 ...

  8. Android 中类似ModelWindow的一个实现

    Android里一般的画面(Activity)都是尽量占满整个屏幕,这样符合单线程的设计, 而有些类似popup之类的子画面,却希望他弹出来的时候表现的如同web的模态窗口 (ModelWindow, ...

  9. 【Android 应用开发】Android中使用ViewPager制作广告栏效果 - 解决ViewPager占满全屏页面适配问题

    . 参考界面 : 携程app首页的广告栏, 使用ViewPager实现        自制页面效果图 : 源码下载地址: http://download.csdn.net/detail/han1202 ...

随机推荐

  1. 8000401a错误解决方式(Excel)

    前一阵子做开发须要用到Excel和Word编程,本人用的是Vista系统,开发环境是VS2005和Office2007,測试无不论什么问题,但是到部署的时候出现了一些令人非常头痛的问题,老是会出现比如 ...

  2. Java基础知识强化23:Java中数据类型转换(面试题)

    1. 以下代码输出结果是( D ).                     public  class  Test   {                                       ...

  3. spring04 spel注入

    1.创建需要的实体类对象 public class Student { //学生实体类 private String name; //姓名 private Integer age; //年龄 priv ...

  4. hdu 2123

    #include <iostream> using namespace std; int main() { int i,t,n,j,k,f; cin>>t; while(t-- ...

  5. CentOS目录结构详解

    CentOS是文件管理系统,在CentOS中所有的程序都以文件形式存储.初学CentOS的朋友需要了解各个挂载点 目录的结构和作用.这样才能更好的去管理系统. CentOS的目录大体上可分为四类:管理 ...

  6. zepto源码研究 - fx_methods.js

    简要:依赖fx.js,主要是针对show,hide,fadeIn,fadeOut的封装. 源码如下: // Zepto.js // (c) 2010-2015 Thomas Fuchs // Zept ...

  7. oracle 分布式数据库

    分布式数据库的数据库链路是单向的

  8. R1:创建Libevent库

    原文链接:http://www.wangafu.net/~nickm/libevent-book/Ref1_libsetup.html Setting up the Libevent library ...

  9. c++虚函数的学习

    1.虚函数 #include<iostream.h> class Base { public: void print() { cout<<"Base"< ...

  10. 利用谷歌 kaptcha 进行验证码生成

    package main.com.smart.controller; import com.google.code.kaptcha.Producer; import main.com.smart.ut ...