我设法插入了一个弹出框,但我无法使弹出框跟随 UISlider .. 它只显示在滑块的右下角.. 我做错了什么?我该如何解决?先感谢您..
percentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 41, 33)];
UIImageView *percentImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 41, 33)];
[percentImageView setImage:[UIImage imageNamed:@"ipad-progress-value.png"]];
[percentView addSubview:percentImageView];
UILabel *percentLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 41, 26)];
[percentLabel setTag:1];
[percentLabel setText:@"m"];
[percentLabel setBackgroundColor:[UIColor clearColor]];
[percentLabel setTextColor:[UIColor whiteColor]];
[percentLabel setFont:[UIFont boldSystemFontOfSize:13]];
[percentLabel setTextAlignment:UITextAlignmentCenter];
[percentLabel setAdjustsFontSizeToFitWidth:YES];
[percentView addSubview:percentLabel];
[_slider addSubview:percentView];