zoukankan      html  css  js  c++  java
  • 自定义水平进度条样式:黑色虚线

    布局layout中使用:

    复制代码
     1 <ProgressBar
     2         android:id="@+id/progress_bar"
     3         style="?android:attr/progressBarStyleHorizontal"         <!--必须设置为水平-->
     4         android:progressDrawable="@drawable/myprogress"          <!--此处用自定义样式-->
     5         android:layout_width="158dp"
     6         android:layout_height="5dp"
     7         android:layout_marginTop="5dp"
     8         android:maxHeight="5dp"
     9         android:minHeight="5dp"
    10         android:max="100"
    11         android:secondaryProgress="0"
    12         android:progress="0"
    13         android:indeterminateOnly="false" />
    复制代码

    下面为xml源代码myprogress.xml:

    复制代码
     1 <?xml version="1.0" encoding="utf-8"?>
     2 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
     3     <!--item background与progress 顺序不可颠倒 -->
     4     <item android:id="@android:id/background" >
     5         <shape android:shape="line">
     6             <stroke
     7                 android:width="4dp" android:color="#666666"          <!--背景颜色和宽度-->
     8                 android:dashWidth="4dp" android:dashGap="1dp" />     <!--虚线间隔1dp-->
     9         </shape>   
    10     </item>
    11     <item android:id="@android:id/progress" >
    12         <clip>
    13             <shape android:shape="line">
    14                 <stroke
    15                     android:width="4dp" android:color="#000000"    
    16                     android:dashWidth="4dp" android:dashGap="1dp" />   
    17             </shape>
    18         </clip>
    19     </item>
    20 </layer-list>
  • 相关阅读:
    springboot之redis的应用
    redis外部访问
    Calendar时间操作
    zookeeper安装
    springboot的interceptor(拦截器)的应用
    springboot中filter的用法
    IIS无法启动,应用程序池自动关闭
    HTTP 错误 403.14
    【转】JavaScript => TypeScript 入门
    angular2使用ng g component navbar创建组件报错
  • 原文地址:https://www.cnblogs.com/dongweiq/p/3927772.html
Copyright © 2011-2022 走看看