有没有办法读取 Interface Builder 的属性检查器中规定的 UISlider 的最大值和最小值?我想将这些值用作 UIView 中 X 坐标的范围,但我不确定如何执行此操作。
- (IBAction)sineXYPad:(UIPanGestureRecognizer *)trigger {
float sinepadHeight = sinexyview.bounds.size.height;
float sinepadWidth = sinexyview.bounds.size.width;
CGPoint location = [trigger locationInView:sinexyview];
if ((location.y >= 0) && (location.y < sinepadHeight) && (location.x >= 0) && (location.x < sinepadWidth)) {
float maxX = sinePSlider.maximumValue;
float minX = sinePSlider.minimumValue;
float sinePitchXY = (location.x > minX) && (location.x < maxX);
sinePSlider.value = sinePitchXY;
[PdBase sendFloat:sinePitchXY toReceiver:@"sine_pitch"];
}
}
这是我的用户界面: