【问题标题】:How to bring up text on image in uipickerview如何在uipickerview中显示图像上的文本
【发布时间】:2013-05-10 05:51:01
【问题描述】:

在 uipickerview 中插入图片之前

在uipickerview中插入图片后

- (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;

}

【问题讨论】:

    标签: ios4 uipickerview xcode4.6 ios6.1


    【解决方案1】:

    在你的代码中你写了这个:-

    [label sendSubviewToBack:pview];
    
     [pview sendSubviewToBack: label];
    

    我认为你在这里做错了..

    你就用这个:-

    [label sendSubviewToBack:pview];
    [label addSubview:pview];
    

    删除这个

     [pview sendSubviewToBack: label];
    

    它会正常工作..如果不随意问..享受..

    【讨论】:

    • skydrive.live.com/… @json 这是我的文件
    • @Harshad 它工作得很好你的项目有什么问题吗?请快速评论..快点去...
    • 我对方法发表了评论,只需删除它们然后运行 ​​app @json
    猜你喜欢
    • 1970-01-01
    • 2013-04-15
    • 2018-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-04
    • 1970-01-01
    相关资源
    最近更新 更多