我想让用户更容易在图表上显示/隐藏十字线。如何减少长按持续时间?
像这样的东西应该可以做到:
#import "SChartCanvas.h"
#import "SChartCanvasOverlay.h"
@interface SChartCanvasOverlay (LongPress)
- (void) changeLongPressDelay:(CFTimeInterval)time;
@end
@implementation SChartCanvasOverlay(LongPress)
- (void) changeLongPressDelay:(CFTimeInterval)time
{
[longPressGesture setMinimumPressDuration: time];
}
@end
上面的方法应该允许您更改长按的延迟时间,如下所示:
[chart.canvas.overlay changeLongPressDelay:0.2];