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. XCode5/Apple LLVM 5.0下使用boost的方法

    Because Apple changes the compiler to llvm only in XCode5, so there are some compatible problems wit ...

  2. Dubbo[一个分布式服务框架

    http://alibaba.github.io/dubbo-doc-static/User+Guide-zh.htm#UserGuide-zh-API%E9%85%8D%E7%BD%AE http: ...

  3. java集合框架02

    public class ListTest { public static void main(String[] args) { //创建几个新闻对象 News news1=new News(1, & ...

  4. Java HttpClient

    public class WebClient { public static final String POST_TYPE_JSON = "json"; public static ...

  5. php long time(1)

    好久好久没有发表新的文章了,主要是懒得在这里写,都记在记事本上,所得都是自己理解的情况下写的,如今借此闲暇记录下来,:::: ****************PHP****************** ...

  6. android-Activity的执行流程

    概述 The following diagram shows the important state paths of an Activity. The square rectangles repre ...

  7. asp.net 定时器

    using System;using System.Collections.Generic;using System.Web;using System.IO;using System.Web.Secu ...

  8. 张羿给的删除重复数据的mssql语句

    select count(1), gsdm, idfrom ods_sc.T_D_DEVICE_COMMONgroup by gsdm, idhaving count(1) > 1; delet ...

  9. Windows下配置环境变量和需不需要重启问题

    http://blog.163.com/guomaolin_gavin/blog/static/19961830720121114929321/

  10. SQL查询表字段、字段说明、类型、长度、主键

    SELECT  表名=d.name,case when a.colorder=1 then d.name else '' end, 字段序号=a.colorder, 字段名=a.name, 标识=ca ...