Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在objective c中使用鼠标光标访问进度条_Ios_Objective C_Progress Bar - Fatal编程技术网

Ios 如何在objective c中使用鼠标光标访问进度条

Ios 如何在objective c中使用鼠标光标访问进度条,ios,objective-c,progress-bar,Ios,Objective C,Progress Bar,我正在使用Mb进度条。其中进度条正在自动访问。在这里,我想用鼠标光标移动进度条 我正在使用Github库 这个库为我提供了动画进度条,它会在单击按钮时自动运行。我就想要这个。但这不应该是自动的。我想用光标一样的手移动它 这是我的代码::: @property (weak, nonatomic) IBOutlet MBCircularProgressBarView *progressBar; @property (weak, nonatomic) IBOutlet UISwitch *an

我正在使用Mb进度条。其中进度条正在自动访问。在这里,我想用鼠标光标移动进度条

我正在使用Github库

这个库为我提供了动画进度条,它会在单击按钮时自动运行。我就想要这个。但这不应该是自动的。我想用光标一样的手移动它

这是我的代码:::

 @property (weak, nonatomic) IBOutlet MBCircularProgressBarView  *progressBar;
 @property (weak, nonatomic) IBOutlet UISwitch *animatedSwitch;

@end

@implementation MBViewController

- (void)viewDidLoad {
[super viewDidLoad];
// pan gesture detects circle dragging
UIPanGestureRecognizer *pv = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)];
//[self addGestureRecognizer:pv];
[self.progressBar addGestureRecognizer:pv];
}

- (IBAction)animate:(UIButton *)sender {
[UIView animateWithDuration:self.animatedSwitch.on * 1.f animations:^{
    self.progressBar.value = 100.f - self.progressBar.value;
}];
}
  # pragma mark detect pan and determine angle of pan location vs. center of circular revolution
 - (void) handlePan:(UIPanGestureRecognizer *)pv {
   self.progressBar.value = 100.f - self.progressBar.value;
}

任何人都能想到。请帮助我::

为什么不使用.progress属性设置UIProgressView并设置其进度?那么,当我将使用光标移动时,如何设置值。yourProgressViewWithProgress.progress=yourValue:)就是这样,buddy:)此外,如果您想使用用户滑动来捕获进度,有一个内置组件称为UISlider使用它,你可以定制滑块头、滑块颜色和许多其他东西:)谢谢@sandeep回复我,但我需要圆形进度条,它应该与给定的lilnk演示完全相同。你看过git hub链接了吗?为什么不简单的UIProgressView并使用.progress属性设置它的进度呢?那么,当我移动光标时,我该如何设置这些值呢?yourProgressViewWithProgress.progress=yourValue:)就是这样,buddy:)此外,如果你想使用用户滑动来捕获进度,还有一个内置的组件叫做UISlider使用它,你可以定制滑块头、滑块颜色和许多其他东西:)谢谢@sandeep回复我,但我需要圆形进度条,它应该与给定的lilnk演示完全相同。你看过git hub链接吗