- 浏览: 477998 次
- 性别:
- 来自: 北京
最新评论
-
fatalfeel:
Irrlicht 3d Engine is full open ...
转:Android世界的15款开源的游戏开发引擎 -
diyangxia:
BigDecimal怎么初始化全局变量呢
android如何保留小数点后x位数字 -
c1230v:
这是一个程序员应该用的方法吗?求靠谱一点
转:android WebView 控件加载本地sdcard中html文件图片的问题 -
dingbuoyi:
楼主是天才 真牛逼
转:Progressbar-设置自己的样式 -
panxiaoming2008:
记住:显示本地文件时 必须使用APK'>file:/// ...
Android使用WebView加载本地资源
、、、、、、、、、、、、、、、、、、、第一种、、、、、、、、、、、、、、、、、、
1.首先,我们要准备我们自己需要的转圈圈的图或者进度条的图片,并且命名为
progressbar_indeterminate1
progressbar_indeterminate2
progressbar_indeterminate3 ...等。
然后写一个xml文件,如下:
<?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/progressbar_indeterminate1" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate2" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate3" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate4" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate5" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate6" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate7" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate8" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate9" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate10" android:duration="200" /> <item android:drawable="@drawable/progressbar_indeterminate11" android:duration="200" /> </animation-list>
2.在我们的Progressbar控件中这么配置我们刚才定义好的样式:
<ProgressBar android:indeterminateDrawable="@drawable/progressbar_indeterminate" android:id="@+id/progressBar1" android:layout_width="wrap_content" android:layout_height="wrap_content"> </ProgressBar>
3.OK,大功告成!! 4.最后总结一下: 、、、、、、、、、、、、、、、、、、、第二种、、、、、、、、、、、、、、、、、、 1.在drawable目录下新建一个progress_drawable_large.xml文件,如是写; 可查看源码:\frameworks\base\core\res\res\drawable\progress_large.xml
我们应该多看一下系统的那些样式,看看google的工程师们是怎么去定义这些东西的,从中我们可以学到很多东西。
顺便说一下,虽然本文讲的Progressbar的样式,但是,我们完全可以把这个设置到一个需要设置动画的页面布局上,比如我们的程序在进入的时候需要播放一个动画,宣传公司的某个产品或者说提示用户怎么操作我们的程序以及一些快捷键什么的,完全可以这么去配置,而不再需要一个ImageView对象和AnimationDrawable对象,来通过start()来播放我们的动画,是不是很方便呐!!哈哈!!<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/bg_loading_1"
android:pivotX="50%"
android:pivotY="50%" />
说明:bg_loading_1.png便是我们要设置的转圈圈的图片,一张便可。是不是比上面的节省资源吖~
2.应用到控件当中去,如是写:
<ProgressBar android:indeterminateDrawable="@drawable/progress_drawable_large" android:indeterminateOnly="true" android:indeterminateDuration="500" android:indeterminateBehavior="repeat" android:layout_width="wrap_content" android:layout_height="wrap_content"></ProgressBar>
说明:indeterminateDuration 设置转动时间
3.没有第三步,oker,大功告成了 ,哈哈,简单吧~
以上方法纯参照系统源码学习:
附:系统部分源码
111.系统中设置长条形进度条进度背景的progress_horizontal.xml:
可查看源码:...frameworks\base\core\res\res\drawable\progress_horizontal.xml
<?xml version="1.0" encoding="utf-8" ?> - <!-- Copyright (C) 2008 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> - <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@android:id/background"> - <shape> <corners android:radius="5dip" /> <gradient android:startColor="#ff9d9e9d" android:centerColor="#ff5a5d5a" android:centerY="0.75" android:endColor="#ff747674" android:angle="270" /> </shape> </item> - <item android:id="@android:id/secondaryProgress"> - <clip> - <shape> <corners android:radius="5dip" /> <gradient android:startColor="#80ffd300" android:centerColor="#80ffb600" android:centerY="0.75" android:endColor="#a0ffcb00" android:angle="270" /> </shape> </clip> </item> - <item android:id="@android:id/progress"> - <clip> - <shape> <corners android:radius="5dip" /> <gradient android:startColor="#ffffd300" android:centerColor="#ffffb600" android:centerY="0.75" android:endColor="#ffffcb00" android:angle="270" /> </shape> </clip> </item> </layer-list>
应用到控件中:
<ProgressBar android:progressDrawable="@drawable/progress_horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"></ProgressBar>
222.系统中几种常见的样式:
可查看源码...\frameworks\base\core\res\res\values\styles.xml
<style name="Widget.ProgressBar"> <item name="android:indeterminateOnly">true</item> <item name="android:indeterminateDrawable">@android:drawable/progress_medium_white</item> <item name="android:indeterminateBehavior">repeat</item> <item name="android:indeterminateDuration">3500</item> <item name="android:minWidth">48dip</item> <item name="android:maxWidth">48dip</item> <item name="android:minHeight">48dip</item> <item name="android:maxHeight">48dip</item> </style> - <style name="Widget.ProgressBar.Large"> <item name="android:indeterminateDrawable">@android:drawable/progress_large_white</item> <item name="android:minWidth">76dip</item> <item name="android:maxWidth">76dip</item> <item name="android:minHeight">76dip</item> <item name="android:maxHeight">76dip</item> </style> - <style name="Widget.ProgressBar.Small"> <item name="android:indeterminateDrawable">@android:drawable/progress_small_white</item> <item name="android:minWidth">16dip</item> <item name="android:maxWidth">16dip</item> <item name="android:minHeight">16dip</item> <item name="android:maxHeight">16dip</item> </style> - <style name="Widget.ProgressBar.Inverse"> <item name="android:indeterminateDrawable">@android:drawable/progress_medium</item> </style> - <style name="Widget.ProgressBar.Large.Inverse"> <item name="android:indeterminateDrawable">@android:drawable/progress_large</item> </style> - <style name="Widget.ProgressBar.Small.Inverse"> <item name="android:indeterminateDrawable">@android:drawable/progress_small</item> </style> - <style name="Widget.ProgressBar.Small.Title"> <item name="android:indeterminateDrawable">@android:drawable/progress_small_titlebar</item> </style> - <style name="Widget.ProgressBar.Horizontal"> <item name="android:indeterminateOnly">false</item> <item name="android:progressDrawable">@android:drawable/progress_horizontal</item> <item name="android:indeterminateDrawable">@android:drawable/progress_indeterminate_horizontal</item> <item name="android:minHeight">20dip</item> <item name="android:maxHeight">20dip</item> </style>
发表评论
-
service学习
2012-05-16 00:41 842http://www.cnblogs. ... -
InputStream,String,File相互转化
2012-05-14 23:32 12401. String --> InputStream ... -
转:实现类似手机QQ的可折叠固定标题列表
2012-04-12 19:05 1356http://douzifly.cnblog ... -
转:[Android]倒影效果的ImagView
2012-04-06 23:29 1339本文源自:http://blog.csdn.net/ke ... -
转:JDK中的URLConnection参数详解
2012-04-06 23:01 1143针对JDK中的URLConnection连 ... -
转:Game Engines for Android (Android游戏引擎)
2012-03-24 13:12 2685With Google IO fast approach ... -
做Android 系统/应用开发怎么可以不懂自动化测试
2012-03-22 15:02 1112http://blog.csdn.net/yiyaaixuex ... -
让Qt应用程序跑在Android上
2012-03-22 14:55 1314http://blog.c ... -
转:在android 2.3 AVD 模拟器上安装 google market 安卓市场
2012-03-22 14:29 1045http:// ... -
增加 addDataScheme("file") 才能收到SD卡插拔事件的原因分析 -- 浅析android事件过滤策略
2012-03-22 14:26 1914... -
转:andengine中的ParticleSystem
2012-01-18 11:08 1491看ParticleSystemSimpleExample,看得 ... -
test4:腾讯
2011-12-26 20:27 2www.qq.com -
test3:Yahoo
2011-12-26 20:25 2www.yahoo.com -
test2:google
2011-12-26 10:53 5www.google.com.hk -
test1:百度
2011-12-26 10:52 6www.baidu.com -
转:android 打包自己的自定义组件成JAR包
2011-12-24 11:54 1245http://www.cnblogs.c ... -
转:AndEngine中的字体加载及应用
2011-12-15 15:39 1512AndEngine中的字体加载及应用 An ... -
转:Android游戏框架AndEngine使用入门
2011-12-13 14:24 1557项目站点:http://www.andengine.org 项 ... -
转:notification更新数字的显示及AnimationDrawable的结合使用
2011-12-07 10:25 2574这是本人加入博客园的首篇博文,自己平常在工作学习过程遇 ... -
转:Android系统上(mv不可用)cp命令的替代方法
2011-11-30 18:32 9631Android系统上cp命令 ...
相关推荐
使用ProgressBar实现进度条,设置进度条显示风格。以及自定义进度条样式
好看的progressbar 样式,弥补winform 默认样式的单调。
进度条样式在项目中经常可以见到,下面小编给大家分享Android三种方式实现ProgressBar自定义圆形进度条。 Android进度条有4种风格可以使用。 默认值是progressBarStyle。 设置成progressBarStyleSmall后,图标变小...
WPF:Metro样式ProgressBar 圆点横向移动 自适应宽度
无法显示进度 - 必须设置「style」为「@android:style/Widget.ProgressBar.Horizontal」 style="@android:style/Widget.ProgressBar.Horizontal" 效果图与示例 apk 点击下载 BGAProgressBarDemo.apk 或扫描下面的...
ics4.0 ProgressBar加载转圈的样式感觉非常棒 但是4.0以下版本无法使用,所以就自定义了一套通用的样式 附件是source code + apk
React循环进度条 圆形进度条组件,使用SVG构建并且可以进行广泛定制。 。 2.0.0版已发布! :waving_hand: 新的功能: ...导入组件和默认样式: import { CircularProgressbar } from 'react-circular-prog
当进行开发的时候,不知道大家有没有注意到,不论是ToolStripProgressBar还是普通的ProgressBar,设置forecolor和backcolor其实是无效的。程序在运行的时候,仍然显示的是绿色的进度条和灰色的背景色。 其实,如果...
Android 各种样式的ProgressBar演示
各种样式的ProgressBar+源代码,最全的例子集合
WCF的主体资源,整理了很多风格 项目描述: WPF Themes 是应用在WPF项目中的免费主题。 支持的控件: -Button -ToggleButton -RadioButton -CheckBox ...-ProgressBar -Slider -TreeView -Expander
progressbar组件在一个可以直接运行的npm包,通过Yeoman进行构建,再通过Gulp+Webpack构建工具,生成的工作目录如下,其中各个文件夹的内容入之前的一篇文章一样 progressbar组件工作目录 :black_medium-small_...
自定义progressBar 自定义样式,遇到的问题。 1. 正常的情况 2. 在程序中设置 progressDrawable 遇到的情况,以及怎么解决。 参考文章 http://blog.csdn.net/chengxiaobo0306/article/details/18960005
MaterialProgressBar 材质样式ProgressBar,扩展视图。 #艺术 #特征支持确定和确定模式。 支持许多属性。 #用法就像android SDK中的ProgreeBar xmlns:app="http://schemas.android.com/apk/res-auto" <...
主要是做了个ProgressBar气泡的气泡样式,然后重写ProgressBar,加了个依赖属性,很简单,大家可以down来研究,用blend打开来看比较直观。
一、ProgressBar 1. 常用类型 1.1 不确定式圆形进度条 style=@android:style/Widget.Holo.Light.ProgressBar style=@android:style/Widget.DeviceDefault.Light.ProgressBar.Large ... 没有显示进度,可作为过场...
经典的使用样式的方法是用圆形的ProgressBar,提供多种演示样式。
默认progressbar进度条是#字符,用起来太单调,如果要设置更加美观的进度条,需要修改下源码。
Android开发之ProgressBar及其style样式的使用一些相关的代码,由于是用kotlin来实现的,所以可能会有不适应,不过代码大同小异,问题不大
Android 自定义各式各样的圆形ProgressBar https://blog.csdn.net/qq_31939617/article/details/80742716