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. 在JAVA中 System.getProperty 和 System.setProperty 方法.

    今天着手研究TOMCAT源码. 在刚開始的时候Startup类中init方法中调用非常多次System.getProperty和System.setProperty的方法. 后来经过网上搜索才得知,这 ...

  2. tail和head命令

    [root@rhel7 ~]# cat rusky --cat命令查看文件内容 line1 line2 line3 line4 line5 line6 line7 line8 line9 line10 ...

  3. 轮播图--JS手写

    轮播图基本每个网站都会有,也有很多的JQuery插件可以用,这里是用JS代码写的. @{ Layout = null; } <!DOCTYPE html> <html> < ...

  4. hdu 2203

    题意: 子串问题 水题,只要把母串*2,然后比较...... 感觉我好懒....没有自己写函数...... 反正我不是勤快的人......... AC代码: #include <iostream ...

  5. Shell语法中的test命令用法

    test命令用法.功能:检查文件和比较值   1)判断表达式 if test (表达式为真) if test !表达式为假 test 表达式1 –a 表达式2 两个表达式都为真 test 表达式1 – ...

  6. (七)Angularjs - 控制器

    控制器的作用 没有控制器/controller,我们没有地方定义业务模型 比如:ng-init指令.我们可以使用ng-init指令在scope对象上定义数据 <div ng-init=" ...

  7. JAVA-1-HelloWorld

    public class HelloWorld{ public static void main(String[] args){ System.out.println("HelloWorld ...

  8. Flume 1.4.0 User Guide

    Apache Flume is a distributed, reliable, and available system for efficiently collecting, aggregatin ...

  9. CentOS 7 之安装X Window System

    网上说的直接 yum groupinstall "Desktop"经实验,在我的机器上是无效的.我使用的是: yum groupinstall 'GNOME Desktop' 才o ...

  10. phpcms v9 读取地区联动菜单缓存文件

    读取缓存文件的方法是 getcache() 在 phpcms\libs\functions\global.func.php 中可找到. 地区联动菜单的缓存文件是  caches\caches_link ...