Ios4 如何在uipickerview中显示图像上的文本
在uipickerview中插入图像之前 在uipickerview中插入图像后Ios4 如何在uipickerview中显示图像上的文本,ios4,uipickerview,xcode4.6,ios6.1,Ios4,Uipickerview,Xcode4.6,Ios6.1,在uipickerview中插入图像之前 在uipickerview中插入图像后 - (UIView *) pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { CGRect imageFrame = CGRectMake(0.0, 0.5, 255, 250);
- (UIView *) pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view {
CGRect imageFrame = CGRectMake(0.0, 0.5, 255, 250);
UIImageView *label = [[UIImageView alloc]
initWithFrame:imageFrame];
label.backgroundColor=[UIColor scrollViewTexturedBackgroundColor];
[label sendSubviewToBack:pview];
[pview sendSubviewToBack: label];
[pview addSubview:label];
return label;
}
在您的代码中,您编写了以下内容:-
[label sendSubviewToBack:pview];
[pview sendSubviewToBack: label];
我认为你在这里做错了
你只要用这个:-
[label sendSubviewToBack:pview];
[label addSubview:pview];
去掉这个
[pview sendSubviewToBack: label];
它会很好的。如果你不想问的话,请尽情享受。@json这是我的file@Harshad工作很好,你的项目有什么问题吗?请快速评论..赶快去…我对方法发表了评论,只是删除它们,然后运行app@json