转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6552712.html

先看效果图:

Step1:定义StepBean

定义五个状态,分别为:为完成、正在进行、已完成、终点完成、终点未完成。

  1. public class StepBean{
  2. public static final int STEP_UNDO = -1;//未完成
  3. public static final int STEP_CURRENT = 0;//正在进行
  4. public static final int STEP_COMPLETED = 1;//已完成
  5. public static final int STEP_LAST_COMPLETED = 2;//终点完成
  6. public static final int STEP_LAST_UNCOMPLETED = 3;//终点未完成
  7. private String name;
  8. private int state;
  9.  
  10. public String getName(){
  11. return name;
  12. }
  13.  
  14. public void setName(String name){
  15. this.name = name;
  16. }
  17.  
  18. public int getState(){
  19. return state;
  20. }
  21.  
  22. public void setState(int state){
  23. this.state = state;
  24. }
  25.  
  26. public StepBean(){
  27. }
  28.  
  29. public StepBean(String name, int state){
  30. this.name = name;
  31. this.state = state;
  32. }
  33. }

Step2:自定义HorizontalStepsViewIndicator 

  1. public class HorizontalStepsViewIndicator extends View {
  2. private int defaultStepIndicatorNum = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 40, getResources().getDisplayMetrics());//定义默认的高度
  3. private float mCompletedLineHeight;//完成线的高度
  4. private float mCircleRadius;//圆的半径
  5.  
  6. private Drawable mCompleteIcon;//完成的默认图片
  7. private Drawable mAttentionIcon;//正在进行的默认图片
  8. private Drawable mDefaultIcon;//默认的背景图
  9. private Drawable mLastCompleteIcon;//终点未完成图片
  10. private Drawable mLastUnCompleteIcon;//终点完成图片
  11.  
  12. private float mCenterY;//该view的Y轴中间位置
  13. private float mLeftY;//左上方的Y位置
  14. private float mRightY;//右下方的位置
  15.  
  16. private List<StepBean> mStepBeanList ;//当前有几步流程
  17. private int mStepNum = 0;
  18. private float mLinePadding;//两条连线之间的间距
  19.  
  20. private List<Float> mCircleCenterPointPositionList;//定义所有圆的圆心点位置的集合
  21. private Paint mUnCompletedPaint;//未完成Paint
  22. private Paint mCompletedPaint;//完成paint
  23. private int mUnCompletedLineColor = ContextCompat.getColor(getContext(), R.color.uncompleted_color);//定义默认未完成线的颜色
  24. private int mCompletedLineColor = ContextCompat.getColor(getContext(), R.color.completed_color);//定义默认完成线的颜色
  25. private PathEffect mEffects;
  26. private int mComplectingPosition;//正在进行position
  27.  
  28. private Path mPath;
  29. private OnDrawIndicatorListener mOnDrawListener;
  30. private int screenWidth;
  31.  
  32. /**
  33. * 设置监听
  34. * @param onDrawListener
  35. */
  36. public void setOnDrawListener(OnDrawIndicatorListener onDrawListener){
  37. mOnDrawListener = onDrawListener;
  38. }
  39.  
  40. /**
  41. * get圆的半径 get circle radius
  42. * @return
  43. */
  44. public float getCircleRadius(){
  45. return mCircleRadius;
  46. }
  47.  
  48. public HorizontalStepsViewIndicator(Context context){
  49. this(context, null);
  50. }
  51.  
  52. public HorizontalStepsViewIndicator(Context context, AttributeSet attrs){
  53. this(context, attrs, 0);
  54. }
  55.  
  56. public HorizontalStepsViewIndicator(Context context, AttributeSet attrs, int defStyle){
  57. super(context, attrs, defStyle);
  58. init();
  59. }
  60.  
  61. private void init(){
  62. mStepBeanList = new ArrayList<>();
  63. mPath = new Path();
  64. mEffects = new DashPathEffect(new float[]{8, 8, 8, 8}, 1);
  65. mCircleCenterPointPositionList = new ArrayList<>();//初始化
  66.  
  67. mUnCompletedPaint = new Paint();
  68. mCompletedPaint = new Paint();
  69. mUnCompletedPaint.setAntiAlias(true);
  70. mUnCompletedPaint.setColor(mUnCompletedLineColor);
  71. mUnCompletedPaint.setStyle(Paint.Style.STROKE);
  72. mUnCompletedPaint.setStrokeWidth(2);
  73. mCompletedPaint.setAntiAlias(true);
  74. mCompletedPaint.setColor(mCompletedLineColor);
  75. mCompletedPaint.setStyle(Paint.Style.STROKE);
  76. mCompletedPaint.setStrokeWidth(2);
  77. mUnCompletedPaint.setPathEffect(mEffects);
  78. mCompletedPaint.setStyle(Paint.Style.FILL);
  79.  
  80. mCompletedLineHeight = 0.03f * defaultStepIndicatorNum;//已经完成线的宽高
  81. mCircleRadius = 0.28f * defaultStepIndicatorNum;//圆的半径
  82. mLinePadding = 1.0f * defaultStepIndicatorNum;//线与线之间的间距
  83.  
  84. mCompleteIcon = ContextCompat.getDrawable(getContext(), R.drawable.complted);//已经完成的icon
  85. mAttentionIcon = ContextCompat.getDrawable(getContext(), R.drawable.attention);//正在进行的icon
  86. mDefaultIcon = ContextCompat.getDrawable(getContext(), R.drawable.default_icon);//未完成的icon
  87. mLastCompleteIcon= ContextCompat.getDrawable(getContext(), R.drawable.last_complted);//终点已完成的icon
  88. mLastUnCompleteIcon= ContextCompat.getDrawable(getContext(), R.drawable.last_uncomplted);//终点未完成的icon
  89. }
  90.  
  91. @Override
  92. protected synchronized void onMeasure(int widthMeasureSpec, int heightMeasureSpec){
  93. int width = defaultStepIndicatorNum * 2;
  94. if(MeasureSpec.UNSPECIFIED != MeasureSpec.getMode(widthMeasureSpec)){
  95. screenWidth = MeasureSpec.getSize(widthMeasureSpec);
  96. }
  97. int height = defaultStepIndicatorNum;
  98. if(MeasureSpec.UNSPECIFIED != MeasureSpec.getMode(heightMeasureSpec)){
  99. height = Math.min(height, MeasureSpec.getSize(heightMeasureSpec));
  100. }
  101. width = (int) (mStepNum * mCircleRadius * 2 - (mStepNum - 1) * mLinePadding);
  102. setMeasuredDimension(width, height);
  103. }
  104.  
  105. @Override
  106. protected void onSizeChanged(int w, int h, int oldw, int oldh){
  107. super.onSizeChanged(w, h, oldw, oldh);
  108. //获取中间的高度,目的是为了让该view绘制的线和圆在该view垂直居中
  109. mCenterY = 0.5f * getHeight();
  110. //获取左上方Y的位置,获取该点的意义是为了方便画矩形左上的Y位置
  111. mLeftY = mCenterY - (mCompletedLineHeight / 2);
  112. //获取右下方Y的位置,获取该点的意义是为了方便画矩形右下的Y位置
  113. mRightY = mCenterY + mCompletedLineHeight / 2;
  114.  
  115. mCircleCenterPointPositionList.clear();
  116. for(int i = 0; i < mStepNum; i++){
  117. //先计算全部最左边的padding值(getWidth()-(圆形直径+两圆之间距离)*2)
  118. float paddingLeft = (screenWidth - mStepNum * mCircleRadius * 2 - (mStepNum - 1) * mLinePadding) / 2;
  119. //add to list
  120. mCircleCenterPointPositionList.add(paddingLeft + mCircleRadius + i * mCircleRadius * 2 + i * mLinePadding);
  121. }
  122.  
  123. /**
  124. * set listener
  125. */
  126. if(mOnDrawListener!=null){
  127. mOnDrawListener.ondrawIndicator();
  128. }
  129. }
  130.  
  131. @Override
  132. protected synchronized void onDraw(Canvas canvas){
  133. super.onDraw(canvas);
  134. if(mOnDrawListener!=null){
  135. mOnDrawListener.ondrawIndicator();
  136. }
  137. mUnCompletedPaint.setColor(mUnCompletedLineColor);
  138. mCompletedPaint.setColor(mCompletedLineColor);
  139. //-----------------------画线-------draw line-----------------------------------------------
  140. for(int i = 0; i < mCircleCenterPointPositionList.size() -1; i++){
  141. //前一个ComplectedXPosition
  142. final float preComplectedXPosition = mCircleCenterPointPositionList.get(i);
  143. //后一个ComplectedXPosition
  144. final float afterComplectedXPosition = mCircleCenterPointPositionList.get(i + 1);
  145. if(i <= mComplectingPosition&&mStepBeanList.get(0).getState()!=StepBean.STEP_UNDO){//判断在完成之前的所有点
  146. //判断在完成之前的所有点,画完成的线,这里是矩形,很细的矩形,类似线,为了做区分,好看些
  147. canvas.drawRect(preComplectedXPosition + mCircleRadius - 10, mLeftY, afterComplectedXPosition - mCircleRadius + 10, mRightY, mCompletedPaint);
  148. } else{
  149. mPath.moveTo(preComplectedXPosition + mCircleRadius, mCenterY);
  150. mPath.lineTo(afterComplectedXPosition - mCircleRadius, mCenterY);
  151. canvas.drawPath(mPath, mUnCompletedPaint);
  152. }
  153. }
  154. //-----------------------画线-------draw line-----------------------------------------------
  155.  
  156. //-----------------------画图标-----draw icon-----------------------------------------------
  157. for(int i = 0; i < mCircleCenterPointPositionList.size(); i++){
  158. final float currentComplectedXPosition = mCircleCenterPointPositionList.get(i);
  159. Rect rect = new Rect((int) (currentComplectedXPosition - mCircleRadius), (int) (mCenterY - mCircleRadius), (int) (currentComplectedXPosition + mCircleRadius), (int) (mCenterY + mCircleRadius));
  160. StepBean stepsBean = mStepBeanList.get(i);
  161. if(stepsBean.getState()==StepBean.STEP_UNDO){
  162. mDefaultIcon.setBounds(rect);
  163. mDefaultIcon.draw(canvas);
  164. }else if(stepsBean.getState()==StepBean.STEP_CURRENT){
  165. mCompletedPaint.setColor(Color.WHITE);
  166. canvas.drawCircle(currentComplectedXPosition, mCenterY, mCircleRadius * 1.1f, mCompletedPaint);
  167. mAttentionIcon.setBounds(rect);
  168. mAttentionIcon.draw(canvas);
  169. }else if(stepsBean.getState()==StepBean.STEP_COMPLETED){
  170. mCompleteIcon.setBounds(rect);
  171. mCompleteIcon.draw(canvas);
  172. }else if(stepsBean.getState()==StepBean.STEP_LAST_COMPLETED){
  173. mLastCompleteIcon.setBounds(rect);
  174. mLastCompleteIcon.draw(canvas);
  175. }else if(stepsBean.getState()==StepBean.STEP_LAST_UNCOMPLETED){
  176. mLastUnCompleteIcon.setBounds(rect);
  177. mLastUnCompleteIcon.draw(canvas);
  178. }
  179. }
  180. //-----------------------画图标-----draw icon-----------------------------------------------
  181. }
  182.  
  183. /**
  184. * 得到所有圆点所在的位置
  185. * @return
  186. */
  187. public List<Float> getCircleCenterPointPositionList()
  188. {
  189. return mCircleCenterPointPositionList;
  190. }
  191.  
  192. /**
  193. * 设置流程步数
  194. * @param stepsBeanList 流程步数
  195. */
  196. public void setStepNum(List<StepBean> stepsBeanList) {
  197. this.mStepBeanList = stepsBeanList;
  198. mStepNum = mStepBeanList.size();
  199.  
  200. if(mStepBeanList!=null&&mStepBeanList.size()>0){
  201. for(int i = 0;i<mStepNum;i++){
  202. StepBean stepsBean = mStepBeanList.get(i);
  203. if(stepsBean.getState()==StepBean.STEP_COMPLETED){
  204. mComplectingPosition = i;
  205. }
  206. }
  207. }
  208. requestLayout();
  209. }
  210.  
  211. /**
  212. * 设置未完成线的颜色
  213. * @param unCompletedLineColor
  214. */
  215. public void setUnCompletedLineColor(int unCompletedLineColor){
  216. this.mUnCompletedLineColor = unCompletedLineColor;
  217. }
  218.  
  219. /**
  220. * 设置已完成线的颜色
  221. * @param completedLineColor
  222. */
  223. public void setCompletedLineColor(int completedLineColor){
  224. this.mCompletedLineColor = completedLineColor;
  225. }
  226.  
  227. /**
  228. * 设置默认图片
  229. * @param defaultIcon
  230. */
  231. public void setDefaultIcon(Drawable defaultIcon){
  232. this.mDefaultIcon = defaultIcon;
  233. }
  234.  
  235. /**
  236. * 设置已完成图片
  237. * @param completeIcon
  238. */
  239. public void setCompleteIcon(Drawable completeIcon){
  240. this.mCompleteIcon = completeIcon;
  241. }
  242.  
  243. public void setLastCompleteIcon(Drawable lastcompleteIcon){
  244. this.mLastCompleteIcon = lastcompleteIcon;
  245. }
  246.  
  247. public void setLastUnCompleteIcon(Drawable lastUnCompleteIcon){
  248. this.mLastUnCompleteIcon = lastUnCompleteIcon;
  249. }
  250.  
  251. /**
  252. * 设置正在进行中的图片
  253. * @param attentionIcon
  254. */
  255. public void setAttentionIcon(Drawable attentionIcon){
  256. this.mAttentionIcon = attentionIcon;
  257. }
  258.  
  259. /**
  260. * 设置对view监听
  261. */
  262. public interface OnDrawIndicatorListener{
  263. void ondrawIndicator();
  264. }
  265. }

Step3:自定义HorizontalStepView 

  1. public class HorizontalStepView extends LinearLayout implements HorizontalStepsViewIndicator.OnDrawIndicatorListener{
  2. private RelativeLayout mTextContainer;
  3. private HorizontalStepsViewIndicator mStepsViewIndicator;
  4. private List<StepBean> mStepBeanList;
  5. private int mComplectingPosition;
  6. private int mUnComplectedTextColor = ContextCompat.getColor(getContext(), R.color.uncompleted_text_color);//定义默认未完成文字的颜色;
  7. private int mComplectedTextColor = ContextCompat.getColor(getContext(), R.color.completed_color);//定义默认完成文字的颜色;
  8. private int mTextSize = 14;//default textSize
  9. private TextView mTextView;
  10.  
  11. public HorizontalStepView(Context context){
  12. this(context, null);
  13. }
  14.  
  15. public HorizontalStepView(Context context, AttributeSet attrs){
  16. this(context, attrs, 0);
  17. }
  18.  
  19. public HorizontalStepView(Context context, AttributeSet attrs, int defStyleAttr){
  20. super(context, attrs, defStyleAttr);
  21. init();
  22. }
  23.  
  24. private void init(){
  25. View rootView = LayoutInflater.from(getContext()).inflate(R.layout.widget_horizontal_stepsview, this);
  26. mStepsViewIndicator = (HorizontalStepsViewIndicator) rootView.findViewById(R.id.steps_indicator);
  27. mStepsViewIndicator.setOnDrawListener(this);
  28. mTextContainer = (RelativeLayout) rootView.findViewById(R.id.rl_text_container);
  29. }
  30.  
  31. /**
  32. * 设置显示的文字
  33. * @param stepsBeanList
  34. * @return
  35. */
  36. public HorizontalStepView setStepViewTexts(List<StepBean> stepsBeanList) {
  37. mStepBeanList = stepsBeanList;
  38. mStepsViewIndicator.setStepNum(mStepBeanList);
  39. return this;
  40. }
  41.  
  42. /**
  43. * 设置未完成文字的颜色
  44. * @param unComplectedTextColor
  45. * @return
  46. */
  47. public HorizontalStepView setStepViewUnComplectedTextColor(int unComplectedTextColor) {
  48. mUnComplectedTextColor = unComplectedTextColor;
  49. return this;
  50. }
  51.  
  52. /**
  53. * 设置完成文字的颜色
  54. * @param complectedTextColor
  55. * @return
  56. */
  57. public HorizontalStepView setStepViewComplectedTextColor(int complectedTextColor) {
  58. this.mComplectedTextColor = complectedTextColor;
  59. return this;
  60. }
  61.  
  62. /**
  63. * 设置StepsViewIndicator未完成线的颜色
  64. * @param unCompletedLineColor
  65. * @return
  66. */
  67. public HorizontalStepView setStepsViewIndicatorUnCompletedLineColor(int unCompletedLineColor) {
  68. mStepsViewIndicator.setUnCompletedLineColor(unCompletedLineColor);
  69. return this;
  70. }
  71.  
  72. /**
  73. * 设置StepsViewIndicator完成线的颜色
  74. * @param completedLineColor
  75. * @return
  76. */
  77. public HorizontalStepView setStepsViewIndicatorCompletedLineColor(int completedLineColor) {
  78. mStepsViewIndicator.setCompletedLineColor(completedLineColor);
  79. return this;
  80. }
  81.  
  82. /**
  83. * 设置StepsViewIndicator默认图片
  84. * @param defaultIcon
  85. */
  86. public HorizontalStepView setStepsViewIndicatorDefaultIcon(Drawable defaultIcon) {
  87. mStepsViewIndicator.setDefaultIcon(defaultIcon);
  88. return this;
  89. }
  90.  
  91. /**
  92. * 设置StepsViewIndicator已完成图片
  93. * @param completeIcon
  94. */
  95. public HorizontalStepView setStepsViewIndicatorCompleteIcon(Drawable completeIcon) {
  96. mStepsViewIndicator.setCompleteIcon(completeIcon);
  97. return this;
  98. }
  99.  
  100. /**
  101. * 设置StepsViewIndicator正在进行中的图片
  102. * @param attentionIcon
  103. */
  104. public HorizontalStepView setStepsViewIndicatorAttentionIcon(Drawable attentionIcon) {
  105. mStepsViewIndicator.setAttentionIcon(attentionIcon);
  106. return this;
  107. }
  108.  
  109. public HorizontalStepView setStepsViewIndicatorLastCompleteIcon(Drawable lastCompleteIcon) {
  110. mStepsViewIndicator.setLastCompleteIcon(lastCompleteIcon);
  111. return this;
  112. }
  113.  
  114. public HorizontalStepView setStepsViewIndicatorLastUnCompleteIcon(Drawable lastUnCompleteIcon) {
  115. mStepsViewIndicator.setLastUnCompleteIcon(lastUnCompleteIcon);
  116. return this;
  117. }
  118.  
  119. /**
  120. * set textSize
  121. * @param textSize
  122. * @return
  123. */
  124. public HorizontalStepView setTextSize(int textSize) {
  125. if(textSize > 0) {
  126. mTextSize = textSize;
  127. }
  128. return this;
  129. }
  130.  
  131. @Override
  132. public void ondrawIndicator() {
  133. if(mTextContainer != null) {
  134. mTextContainer.removeAllViews();
  135. List<Float> complectedXPosition = mStepsViewIndicator.getCircleCenterPointPositionList();
  136. if(mStepBeanList != null && complectedXPosition != null && complectedXPosition.size() > 0) {
  137. for(int i = 0; i < mStepBeanList.size(); i++) {
  138. mTextView = new TextView(getContext());
  139. mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTextSize);
  140. mTextView.setText(mStepBeanList.get(i).getName());
  141. int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
  142. mTextView.measure(spec, spec);
  143. // getMeasuredWidth
  144. int measuredWidth = mTextView.getMeasuredWidth();
  145. mTextView.setX(complectedXPosition.get(i) - measuredWidth / 2);
  146. mTextView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
  147.  
  148. if(i <= mComplectingPosition) {
  149. mTextView.setTypeface(null);
  150. mTextView.setTextColor(mComplectedTextColor);
  151. } else{
  152. mTextView.setTextColor(mUnComplectedTextColor);
  153. }
  154. mTextContainer.addView(mTextView);
  155. }
  156. }
  157. }
  158. }
  159. }

Step4:如何使用?

在布局文件xml中:

  1. <cn.comnav.utrain.ui.widget.HorizontalStepView
  2. android:id="@+id/hsv_step_view"
  3. android:layout_width="match_parent"
  4. android:layout_height="80dp"
  5. android:layout_below="@+id/ll_role"
  6. android:layout_marginBottom="40dp"
  7. />

在Activity中的使用,部分代码截取:

  1. private List<StepBean> stepsBeanList;
  2. private HorizontalStepView mHorizontalStepView;
  3. mHorizontalStepView=(HorizontalStepView)findViewById(R.id.hsv_step_view);
  4.  
  5. stepsBeanList = new ArrayList<>();
  6. StepBean stepBean0=null;
  7. StepBean stepBean1=null;
  8. StepBean stepBean2=null;
  9. StepBean stepBean3=null;
  10. switch (stepIndex){
  11. case 1:
  12. stepBean0 = new StepBean("手机绑定",1);
  13. stepBean1 = new StepBean("实名认证",0);
  14. stepBean2 = new StepBean("学时充值",-1);
  15. stepBean3 = new StepBean("开始用车",3);
  16. break;
  17. case 2:
  18. stepBean0 = new StepBean("手机绑定",1);
  19. stepBean1 = new StepBean("实名认证",1);
  20. stepBean2 = new StepBean("学时充值",0);
  21. stepBean3 = new StepBean("开始用车",3);
  22. break;
  23. case 3:
  24. stepBean0 = new StepBean("手机绑定",1);
  25. stepBean1 = new StepBean("实名认证",1);
  26. stepBean2 = new StepBean("学时充值",1);
  27. stepBean3 = new StepBean("开始用车",2);
  28. break;
  29. }
  30. stepsBeanList.add(stepBean0);
  31. stepsBeanList.add(stepBean1);
  32. stepsBeanList.add(stepBean2);
  33. stepsBeanList.add(stepBean3);
  34. mHorizontalStepView.setStepViewTexts(stepsBeanList);

如果此文对您有帮助,微信打赏我一下吧~

android 仿摩拜单车共享单车进度条实现StepView的更多相关文章

  1. 我的Android进阶之旅------>Android自定义View实现带数字的进度条(NumberProgressBar)

    今天在Github上面看到一个来自于 daimajia所写的关于Android自定义View实现带数字的进度条(NumberProgressBar)的精彩案例,在这里分享给大家一起来学习学习!同时感谢 ...

  2. Android 高手进阶,自己定义圆形进度条

    背景介绍 在Android 开发中,我们常常遇到各种各样绚丽的控件,所以,依靠我们Android本身所带的控件是远远不够的,许多时候须要我们自定义控件,在开发的过程中.我们公司遇到了一种须要自己写的一 ...

  3. Android自定义控件系列之应用篇——圆形进度条

    一.概述 在上一篇博文中,我们给大家介绍了Android自定义控件系列的基础篇.链接:http://www.cnblogs.com/jerehedu/p/4360066.html 这一篇博文中,我们将 ...

  4. 让android系统中任意一个view变成进度条

    1.效果 2.进度条背景drawable文件 结束后可以恢复原背景. <?xml version="1.0" encoding="utf-8"?> ...

  5. Android中的常用控件之进度条(ProgressBar)

    ProgressBar的常用属性:style,进度条的样式,默认为圆形,用style="?android:attr/progressBarStyleHorizontal"可以将进度 ...

  6. 仿UC浏览器图片加载进度条

    前几天用UC浏览器看新闻(无意中给UC打了广告),看到它的图片加载进度条,正好最近有时间,所以就自己写了一个. 效果图如下 进度条的底色和填充颜色都可以调整. 首先中间的笑脸作为一个整体,其实现代码如 ...

  7. Android 三种方式实现自定义圆形进度条ProgressBar

    一.通过动画实现 定义res/anim/loading.xml如下: <?xml version="1.0" encoding="UTF-8"?> ...

  8. Android UI系列-----时间、日期、Toasts和进度条Dialog

    您可以通过点击 右下角 的按钮 来对文章内容作出评价, 也可以通过左下方的 关注按钮 来关注我的博客的最新动态. 如果文章内容对您有帮助, 不要忘记点击右下角的 推荐按钮 来支持一下哦 如果您对文章内 ...

  9. Android 自学之进度条ProgressBar

    进度条(ProgressBar)也是UI界面中的一种非常使用的组件,通常用于向用户显示某个耗时完成的百分比.因此进度条可以动态的显示进度,因此避免长时间地执行某个耗时操作时,让用户感觉程序失去了响应, ...

随机推荐

  1. Flex移动应用程序开发的技巧和窍门(四)

    范例文件 flex-mobile-dev-tips-tricks-pt4.zip 这是本系列文章的第四部分,该系列文章涵盖Flex移动开发的秘诀与窍门. 第一部分关注切换视图以及切换执行应用时的数据处 ...

  2. SSM(Maven集成)

    ssm全称:Spring+SpringMVC+Mybatis ssm简介: 1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod J ...

  3. SQL 2005 安装数据库镜像教程

    最近在搞在SQL 2005安装数据库镜像,中间遇到不少的错误,在此归纳总结,以方便有需要的朋友参考. 直接上脚本,主机部分: ---修改数据库为完整恢复模式USE master;ALTER DATAB ...

  4. node源码详解(二 )—— 运行机制 、整体流程

    本作品采用知识共享署名 4.0 国际许可协议进行许可.转载保留声明头部与原文链接https://luzeshu.com/blog/nodesource2 本博客同步在https://cnodejs.o ...

  5. line-height系列——定义和工作原理总结

    一.line-height的定义和工作原理总结 line-height的属性值: normal    默认  设置合理的行间距. number  设置数字,此数字会与当前的字体尺寸相乘来设置行间距li ...

  6. Jquery实现的几款漂亮的时间轴

    引言 最近项目中使用了很多前端的东西,对于我一个做后台开发的人员,这是一个很好的锻炼的机会.经过这段时间的学习,感觉前端的东西太多了,太强大了,做出来的东西太炫酷了.现在有很多开源的前端框架,做的都非 ...

  7. 未来手机Alo即将问世!全息投影手机的新高峰!全息3d 网

    文章来源:网络         编辑:大熊 [摘要]全息投影手机很早就开始炒,网络上的概念机也是丛出不穷,那么这款出自法国的概念机又是多么的奇葩?全息 3d 网带你一探究竟. 据外媒报道,在不久将来语 ...

  8. 内功心法 -- java.util.ArrayList<E> (5)

    写在前面的话:读书破万卷,编码如有神--------------------------------------------------------------------下文主要对java.util ...

  9. WP8.1应用双击返回键退出程序。

    #region 双击退出程序代码 //双击HardwareButtons.BackPressed: //出现退出提示窗口: //“确定”退出,“取消”返回什么也不做: private async vo ...

  10. 学习笔记——Java数组

    1.创建一维数组 最简单快捷的方法是:声明的同时为数组分配内存.如: int month[]=new int[12] 也可以先声明再分配内存.如: int month[]; //或int[] mont ...