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. hdu1074 Doing Homework(状态压缩DP Y=Y)

    Doing Homework Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) T ...

  2. [转] PostgreSQL的时间/日期函数使用

    PS:http://blog.csdn.net/love_rongrong/article/details/6712883 字符串模糊比较 日期类型的模糊查询是不能直接进行的,要先转换成字符串然后再查 ...

  3. [转] 强大的python字符串解析

    1.python字符串通常有单引号('...').双引号("...").三引号("""...""")或('''...'' ...

  4. Android 面试精华题目总结

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/24015867 下面的题目都是楼主在android交流群大家面试时遇到的,如果大家 ...

  5. JAVA - hashcode与equals作用、关系

      Hashcode的作用 总的来说,Java中的集合(Collection)有两类,一类是List,再有一类是Set.前者集合内的元素是有序的,元素可以重复:后者元素无序,但元素不可重复.      ...

  6. GBK编码和UTF-8编码互转的大坑

    这几天遇到一个BUG,问题很简单,解决却花了3.4天,特意记录下来. linux环境下,将默认编码设置为GBK以后,运行GBK编码的脚本,调用一个Java的jar包,然后总jar包中返回GBK字符串. ...

  7. X5SDK 腾讯浏览器内核

    介绍 官网:http://x5.tencent.com/ 文档:http://x5.tencent.com/doc?id=1003  腾讯浏览服务由QQ浏览器团队出品,致力于优化移动端[webview ...

  8. 画画 保存为图片 MaskFilter 边缘效果

    使用 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> publ ...

  9. Jquery插件-Html5图片上传并裁剪

    /** * 图片裁剪 * @author yanglizhe * 2015/11/16 */ (function($){ /** * Drag */ var Drag={obj:null,init:f ...

  10. HTML5摇一摇

    方式一 (function(){ /** * 摇一摇 * @author rubekid */ function Shake(options){ this.init(options); } Shake ...