控件UISlider轻滑动问题,求问什么原因
1个回答
展开全部
CGFloat sliderCoorX,sliderWidth;
sliderCoorX = BUTTON_SPACE+BUTTON_CHAPTER_WIDTH+BUTTON_SPACE;
sliderWidth = self.frame.size.width-sliderCoorX-BUTTON_SPACE-BUTTON_CHAPTER_WIDTH-BUTTON_SPACE;
slider = [[UISlider alloc] initWithFrame:CGRectMake(sliderCoorX, BUTTON_Y, sliderWidth, BUTTON_CHAPTER_HEIGHT)];
[slider setMinimumValue:0];
[slider setMaximumValue:document.bookSize];
CGFloat value = document.currentPageOffset;
[slider setValue:value];
[slider setContinuous:YES];
[slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
[slider addTarget:self action:@selector(drag:) forControlEvents:UIControlEventTouchUpInside];
[slider setThumbImage:[UIImage imageNamed:@"TxtSlider_ball.png"] forState:UIControlStateNormal];
[slider setMinimumTrackImage:[[UIImage imageNamed:@"TxtSliderSelected.png"] stretchableImageWithLeftCapWidth:10 topCapHeight:0] forState:UIControlStateNormal];
[slider setMaximumTrackImage:[[UIImage imageNamed:@"TxtSliderAll.png"]
sliderCoorX = BUTTON_SPACE+BUTTON_CHAPTER_WIDTH+BUTTON_SPACE;
sliderWidth = self.frame.size.width-sliderCoorX-BUTTON_SPACE-BUTTON_CHAPTER_WIDTH-BUTTON_SPACE;
slider = [[UISlider alloc] initWithFrame:CGRectMake(sliderCoorX, BUTTON_Y, sliderWidth, BUTTON_CHAPTER_HEIGHT)];
[slider setMinimumValue:0];
[slider setMaximumValue:document.bookSize];
CGFloat value = document.currentPageOffset;
[slider setValue:value];
[slider setContinuous:YES];
[slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
[slider addTarget:self action:@selector(drag:) forControlEvents:UIControlEventTouchUpInside];
[slider setThumbImage:[UIImage imageNamed:@"TxtSlider_ball.png"] forState:UIControlStateNormal];
[slider setMinimumTrackImage:[[UIImage imageNamed:@"TxtSliderSelected.png"] stretchableImageWithLeftCapWidth:10 topCapHeight:0] forState:UIControlStateNormal];
[slider setMaximumTrackImage:[[UIImage imageNamed:@"TxtSliderAll.png"]
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询