Create a drawable in your Drawable folder called vertical_progress_bar.xml:

<?xml version="1.0" encoding="utf-8" ?>
<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="180"
/>
</shape>
</item> <item android:id="@android:id/secondaryProgress">
<clip android:clipOrientation="vertical" android:gravity="bottom">
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#80ffd300"
android:centerColor="#80ffb600"
android:centerY="0.75"
android:endColor="#a0ffcb00"
android:angle="180"
/>
</shape>
</clip>
</item> <item android:id="@android:id/progress">
<clip android:clipOrientation="vertical" android:gravity="bottom">
<shape>
<corners android:radius="5dip" />
<gradient
android:startColor="#ffffd300"
android:centerColor="#ffffb600"
android:centerY="0.75"
android:endColor="#ffffcb00"
android:angle="180"
/>
</shape>
</clip>
</item> </layer-list>

Create a styles.xml file in the Resource/Values folder:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="Widget">
</style> <style name="Widget.ProgressBar">
<item name="android:indeterminateOnly">true</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.Vertical">
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/vertical_progress_bar</item>
<item name="android:indeterminateDrawable">@android:drawable/progress_indeterminate_horizontal</item>
<item name="android:minWidth">1dip</item>
<item name="android:maxWidth">12dip</item>
</style>
</resources>

Now you should be able to use something like, in your layout:

<ProgressBar
android:layout_width="12dip"
android:layout_height="300dip"
style="@style/Widget.ProgressBar.Vertical"
android:id="@+id/progressBar2"/>

Make ProgressBar Vertical的更多相关文章

  1. android 实现垂直的ProgressBar

    I had recently come across the need for a vertical progress bar but was unable to find a solution us ...

  2. 音量调节条-封装通用的ProgressBar组件

    import React, { Component } from 'react' import PropTypes from 'prop-types' import assign from 'obje ...

  3. android中ProgressBar和ListView

    ProgressBar进度条的使用情况: 进度条的.xml声明:如果不声明格式,则默认格式为转圆圈的形式,声明进度条的visibility为不可见. <ProgressBar android:i ...

  4. 背水一战 Windows 10 (34) - 控件(进度类): RangeBase, Slider, ProgressBar, ProgressRing

    [源码下载] 背水一战 Windows 10 (34) - 控件(进度类): RangeBase, Slider, ProgressBar, ProgressRing 作者:webabcd 介绍背水一 ...

  5. ProgressBar显示进度值,垂直或者水平滚动条

    过去一段时间,在研究Windows的系统控件ProgressBar,一直奇怪为啥它不能显示进度值,本以为是个很简单的问题,结果搜索很久,也没有找到好的解决方案,最后终于找到一个Perfect方案,特记 ...

  6. Android之ProgressBar

    今天复习一下以前的知识,补充一下ProgressBar控件 progressBar是进度条组件,通常用于用户展示某个耗时操作完成的进度,而不让用户感觉是程序失去了响应,从而更好地提升用户界面的友好性. ...

  7. 控件(进度类): RangeBase, Slider, ProgressBar, ProgressRing

    1.RangeBase(基类) 的示例Controls/ProgressControl/RangeBaseDemo.xaml <Page x:Class="Windows10.Cont ...

  8. Android学习笔记——ProgressBar

    该工程的功能是实现进度条的显示,按以下按钮进度条增加10% 以下代码是MainActivity.java中的代码 package com.example.progressbar; import and ...

  9. Android -- ProgressBar(进度条的使用)

    我们在开发程序是经常会需要软件全屏显示.自定义标题(使用按钮等控件)和其他的需求,今天这一讲就是如何控制Android应用程序的窗体显示. requestWindowFeature可以设置的值有:(具 ...

随机推荐

  1. GitLab 安装(推荐)

    参考文档: https://about.gitlab.com/installation/#centos-7 基础环境 [root@node1 ~]# uname -r -.el7.x86_64 [ro ...

  2. 喵哈哈村的魔法考试 Round #12 (Div.2) 题解

    A 注意答案会超过int,考虑分l,r奇数和偶数来考虑即可. #include<bits/stdc++.h> using namespace std; long long l,r; int ...

  3. java字符串反转

    1.递归反转 public static String reverseString(String x) { if (x == null || x.length() < 2) return x; ...

  4. aps.net手写验证模型的方法

    /// <summary> /// 基础验证类 /// </summary> public class BaseValidator { /// <summary> ...

  5. 访问win10的远程桌面(Remote Desktop)总是凭据或者用户密码错误

    家里电脑是Win10的,原来可以在公司通过远程桌面访问,最近自动升级了一次补丁后,远程可以连接,但是输入正确的用户密码后总提示凭据错误 (Win10是被访问的一方,修改的也是被访问的机器) 修复方式为 ...

  6. windows环境下面批量移动文件到指定文件夹里面

    move D:批量新建文件夹\upload\20171225173033565_2052.jpg D:批量新建文件夹\1623 move D:批量新建文件夹\upload\20171225174344 ...

  7. iOS开发-装饰模式

    装饰模式是指在不必改变原类文件和使用继承的情况下,动态地扩展一个对象的功能.通过创建一个包装对象,也就是装饰来包裹真实的对象.装饰模式中的装饰对象和真实对象有相同的接口.这样客户端对象就能以和真实对象 ...

  8. 机器学习算法中的偏差-方差权衡(Bias-Variance Tradeoff)

    简单的以下面曲线拟合例子来讲: 直线拟合后,相比原来的点偏差最大,最后一个图完全拟合了数据点偏差最小:但是拿第一个直线模型去预测未知数据,可能会相比最后一个模型更准确,因为最后一个模型过拟合了,即第一 ...

  9. python eric6 IDE

    之前开发一直使用sublime text + anaconda, 无意中发现了eric, Python主流IDE对比:Eric VS. PyCharm 使用IDE绝对是能提高开发效率的... http ...

  10. CucumberPeople 1.3.2 发布

    CucumberPeople 网站: http://alterhu.github.io/CucumberPeople/ This eclipse plugin based on RubyMine ,a ...