Tôi muốn tạo thanh trượt phạm vi. nhưng wahen tôi chỉ định 2 thanh trượt ở cùng một vị trí thì chỉ 1 đang hoạt động. Tôi đã tìm thấy một số API bên ngoài để tạo Thanh trượt. Có cách nào để tạo thanh trượt Phạm vi trong iOS theo lập trình hay không.Làm thế nào để tạo phạm vi trượt một cách có lập trình trong iOS?
Đây là mã của tôi ..
CGRect frame = CGRectMake(20, 330, 300, 60);
slider1 = [[UISlider alloc] initWithFrame:frame];
[slider1 addTarget:self action:@selector(sliderActionMin:) forControlEvents:UIControlEventValueChanged];
[slider1 setBackgroundColor:[UIColor clearColor]];
slider1.minimumValue = 0.0;
slider1.maximumValue = 55.0;
slider1.continuous = YES;
slider1.value= 16
slider1.contentMode=UIViewContentModeScaleToFill;
[self.view addSubview:slider1];
slider2 = [[UISlider alloc] initWithFrame:frame];
[slider2 addTarget:self action:@selector(sliderActionMin:) forControlEvents:UIControlEventValueChanged];
[slider2 setBackgroundColor:[UIColor clearColor]];
slider2.minimumValue = 0.0;
slider2.maximumValue = 55.0;
slider2.continuous = YES;
slider2.contentMode=UIViewContentModeScaleToFill;
slider2.value=[SingletonClass sharedSingleton].minAge;
[self.view addSubview:slider2];
Tại sao bạn chỉ định 2 thanh trượt ở cùng một vị trí? – Bannings
Nó có nghĩa là hai thanh trượt ở một vị trí, 1 cho giá trị tối thiểu và 2 là giá trị lớn nhất .. bạn có hiểu không? –
@ Bannings-Vì tôi muốn thể hiện độ tuổi. như 16 đến 22 –