好的我现在承认我是新手使用进度条我从不使用它但现在我需要使用它我有一个活动(主)和一个菜单,可以启动6个新的活动.从这些活动中有一个活动,它在ListView中加载数据需要3-4秒才能加载.这个活动解析json并将数据传递给另一个活动.如果用户单击此活动的菜单选项,我将如何显示进度条,并在加载列表时将其消失.
这是活动
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent=new Intent(this ,GetLatAndLng.class);
setContentView(R.layout.listplaceholder);
//ProgressBar pb=(ProgressBar)findViewById(R.id.progressbar);
LocationManager locationManager;
String context=Context.LOCATION_SERVICE;
locationManager=(LocationManager)getSystemService(context);
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setAltitudeRequired(false);
criteria.setBearingRequired(false);
criteria.setCostAllowed(true);
criteria.setPowerRequirement(Criteria.POWER_LOW);
String provider = locationManager.getBestProvider(criteria, true);
Location location = locationManager.getLastKnownLocation(provider);
final LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
updateWithNewLocation(location);
}
public void onProviderDisabled(String provider){
updateWithNewLocation(null);
}
public void onProviderEnabled(String provider){ }
public void onStatusChanged(String provider, int status,
Bundle extras){ }
};
updateWithNewLocation(location);
locationManager.requestLocationUpdates(provider, 2000, 10,
locationListener); …Run Code Online (Sandbox Code Playgroud) 我正在玩Java的ProgressMonitorInputStream来监视数据流经BufferedInputStream.这是我正在尝试的代码:
InputStream in = new BufferedInputStream(
new ProgressMonitorInputStream(
new JFrame(),"Scanning",new FileInputStream(dir.getSearchInputFile())));
Run Code Online (Sandbox Code Playgroud)
这非常合适,并弹出一个新的JFrame窗口,其中包含一个显示输入流进度的进度条.
有没有让ProgressMonitorInputstream更新另一个JFrame中存在的现有JProgressBar?
我尝试了各种方法,例如使用构造函数传递JProgressBar,或尝试在参数中指定帧.每次我尝试,我只是得到一个新的JFrame.
我错了吗?
任何投入将不胜感激.
谢谢
我目前有一个用于上传图像文件的PHP脚本,但我正在尝试查找或创建一个简单的jquery进度条来上传.
有谁知道我可以用来做这个的脚本?我不想替换我的整个上传机制,因为它工作得非常好.我只想向用户显示上传状态.
有关如何从PHP获取当前状态并将其传递给jquery的任何建议?
我只是想显示一个进度条.我找到了一些参考代码来显示它.它相当简单,但似乎没有工作.这是在C# - Winforms中.
我忘记了什么吗?
ProgressBar progressBar = new ProgressBar();
progressBar.Show();
progressBar.Visible = true;
Run Code Online (Sandbox Code Playgroud)
提前致谢
我有一个用HTML声明的图像:
<img src="images/image_01.gif" id="man_img_file" width="400" height="300" alt="image_01" />
Run Code Online (Sandbox Code Playgroud)
我正在通过jQuery更改图像:
$('#man_img_file').attr('src', "images/image_02.gif");
Run Code Online (Sandbox Code Playgroud)
现在我想在图像加载时显示百分比进度条(即,当新的src图像通过jQuery加载时).怎么能实现这一目标?可以使用jQuery进度条完成吗?
注意:图像已经在服务器中,我可以在加载之前通过PHP脚本获取图像大小.
我正在尝试添加进度条以显示播放期间歌曲的位置.它只需要一个简单的解决方案.我在网上找到了一些代码,它使用SoundManager2 http://www.schillmania.com/projects/soundmanager2/功能调整div宽度以匹配歌曲的位置,但它似乎没有工作,不知道我要去哪里错了,任何帮助将不胜感激.
我已经使用了所有必需的Soundmanager2文件和播放的歌曲工作.它只是进度条的问题.
这是javascript:
soundManager.setup({
url: '/swf',
preferFlash: false,
waitForWindowLoad: true,
onready: function() {
var myTrack1 = soundManager.createSound({
id: 'trackOne', url: 'msamples/beep-1.mp3', volume: 80, autoPlay: false,});
$(".progBar").css('width', ((this.position/this.duration) * 100) + '%');
$("li.a5 a").click(function(event){soundManager.play('trackOne');});
},
ontimeout: function() {
// Uh-oh. SWF missing, Flash blocked or other issue
}
});
Run Code Online (Sandbox Code Playgroud)
HTML链接使用此格式,进度条位于下方:
<li class="a5">Song1:
<a href="msamples/beep-1.mp3" title="Play" class="sm2_button">Play</a>
<div id="track1"><div class="progBar"></div></div>
</li>
Run Code Online (Sandbox Code Playgroud)
CSS是:
#track1 {
background-color: #333333;
height: 10px;
margin-top: 10px;
position: relative;
width: 100%;
}
.progBar {
background-color:#FFF;
height:10px;
} …Run Code Online (Sandbox Code Playgroud) 我已经四处寻找解决问题的方法,但我相信很多可用的解决方案都是为了解决这个问题.
基本上我在Datagrid单元格中有一个正在运行的进度条.但是,我现在想在进度条中放置文本以显示实际百分比.这是怎么做到的?
到目前为止我的代码
<DataGridTemplateColumn Header="Percentage Downloaded" Width="5*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ProgressBar Value="{Binding Path=PercentageDownloaded, Mode=OneWay}" Minimum="0" Maximum="100" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
Run Code Online (Sandbox Code Playgroud)
为了代表我付出努力,我尝试在进度条中使用tag属性并使用两个都失败的文本块.
非常感谢
*解决方案*
GiangregorioC提供的解决方案有效,因为我没有意识到你可以将标签放在DataGridCellTemplate中!
我正在尝试使用golang进行文件下载.
我正在下载文件,没关系.在我使用cheggaaa的进度条库之后.但我不能动态.
我该怎么做动态进度条?
我的代码如下:
包主
import (
"flag"
"fmt"
"io"
"net/http"
"net/url"
"os"
"strings"
"github.com/cheggaaa/pb"
"time"
)
/*
usage = usage text
version = current number
help use Sprintf
*cliUrl from cmd
*cliVersion from cmd
*cliHelp * from cmd
*/
var (
usage = "Usage: ./gofret -url=http://some/do.zip"
version = "Version: 0.1"
help = fmt.Sprintf("\n\n %s\n\n\n %s", usage, version)
cliUrl *string
cliVersion *bool
cliHelp *bool
)
func init() {
/*
if *cliUrl != "" {
fmt.Println(*cliUrl)
}
./gofret -url=http://somesite.com/somefile.zip
./gofret -url=https://github.com/aligoren/syspy/archive/master.zip …Run Code Online (Sandbox Code Playgroud) 如何在音频播放时使用咆哮js并更新进度栏?
我假设我使用了其中一个pos,seek但是似乎无法正常工作。
我可以创建一个on事件侦听器以在每次位置更改时进行更改吗?
进度栏HTML:
<progress id="progress_bar" value="0.0" max="1.0" style="-webkit-appearance: none; appearance: none; height: 48px; float: left;"></progress>
Run Code Online (Sandbox Code Playgroud)
咆哮js:
on ('update_progress', function() {
document.getElementById('progress_bar').value = audio.pos();
}),
Run Code Online (Sandbox Code Playgroud)
然后,如果按下进度条,如何更新音频的位置。我认为在这种情况下使用输入范围可能会更好。
我正在使用以下Python脚本通过FTP下载文件。我想要的是在下载时查看进度的详细信息。为此,我使用了ProgressBar它,但没有显示任何内容。
这是我的代码:
import re
import os
import ftplib
import ntpath
import sys
import time
from progressbar import AnimatedMarker, Bar, BouncingBar, Counter, ETA, \
AdaptiveETA, FileTransferSpeed, FormatLabel, Percentage, \
ProgressBar, ReverseBar, RotatingMarker, \
SimpleProgress, Timer, UnknownLength
ftp = ftplib.FTP("Your IP address")
ftp.login("Username", "password")
files = []
try:
ftp.cwd("/feed_1")
files = ftp.nlst()
for fname in files:
res = re.findall("2018-07-25", fname)
if res:
print 'Opening local file ' + ntpath.basename(fname)
file = open(ntpath.basename(fname), 'wb')
print 'Getting ' + ntpath.basename(fname)
try:
widgets …Run Code Online (Sandbox Code Playgroud) progress-bar ×10
jquery ×3
c# ×2
javascript ×2
android ×1
datagrid ×1
download ×1
ftp ×1
ftplib ×1
go ×1
howler.js ×1
html5 ×1
image-load ×1
inputstream ×1
java ×1
php ×1
python ×1
swing ×1
winforms ×1
wpf ×1