2013-05-10 55 views
0

插入圖像前uipickerview enter image description here如何彈出文本圖像中uipickerview

插入圖片後在uipickerview

enter image description here

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

} 

回答

0

在你的代碼寫了這個: -

[label sendSubviewToBack:pview]; 

[pview sendSubviewToBack: label]; 

我認爲你是在這裏做什麼錯誤..

你只需要使用這樣的: -

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

刪除此

[pview sendSubviewToBack: label]; 

,將工作fine..if不會隨意問..享受..

+0

你只是分享您的代碼,我將編輯和送你回去.. – Shivaay 2013-05-10 06:32:44

+0

https://skydrive.live.com/?cid=A0B31648B2E37C13&id=A0B31648B2E37C13!106 @json它我的文件 – Harshad 2013-05-10 07:00:39

+0

@Harshad給我一點時間.. – Shivaay 2013-05-10 07:22:35