2012-04-19 15 views
0

詳細ビューを3つの異なるテーブルに1つ持っていますテーブルをベースにいくつかの値(背景画像の色はタイル)を変更する必要があります。 ?詳細を見る

あなたが詳細ビューコントローラをプッシュする前に、あなたの詳細ビューの背景を設定することができ、詳細ビュー

//Definizione Foto 
NSString *photo = mieRicette.foto; 
foto.image = [UIImage imageNamed:photo]; 


//Definizione Foto Orizzontale 
NSString *photoOrizz = mieRicette.foto; 
fotoOrizz.image = [UIImage imageNamed:photoOrizz]; 



//definizione Nome Orizzontale 
nomeOrizz.font = [UIFont fontWithName:@"populaire" size:37.5]; 
nomeOrizz.textColor = [UIColor whiteColor]; 
nomeOrizz.text=mieRicette.nome; 


//definizione Dose 
dose.font = [UIFont fontWithName:@"populaire" size:25]; 
dose.textColor = [UIColor whiteColor]; 
dose.text=mieRicette.dose; 


//definizione Nome e suo colore 
nome.font = [UIFont fontWithName:@"LegacySerifLT-MediumItalic" size:25]; 
nome.text = mieRicette.nome; 
nome.textColor = [UIColor colorWithRed:55.0f/255.0f green:70.0f/255.0f blue:48.0f/255.0f alpha:1.0f]; 


//definizione Tempo 
tempo.font = [UIFont fontWithName:@"populaire" size:25]; 
tempo.textColor = [UIColor colorWithRed:55.0f/255.0f green:70.0f/255.0f blue:48.0f/255.0f alpha:1.0f]; 
tempo.text=mieRicette.tempo; 


//definizione Background 
NSString *bck = mieRicette.bck; 
background.image = [UIImage imageNamed:bck];  
+0

ご迷惑をおかけして申し訳ございません。あなたの問題は何ですか? –

+0

私の状況は3つのテーブルビューと1つの詳細ビューです。 私は、元のテーブルのベースで詳細なビューを変更する必要があります。 私の悪い話をおかけして申し訳ありません。 – Acunamatata

答えて

3

step1。各テーブルビューのタグを設定します。例えば、タグ0,1,2

step2です。 detailedviewcontrollerで1つのuiimageインスタンスを作成し、合成します

step3。詳細ビューコントローラを押す前に、詳細ビューコントローラの画像をテーブルビューに基づいて設定してください

+0

そう簡単に、私のためには難しい...しかし今あなたの説明の後に私は勝つ!ありがとう;) – Acunamatata

1

を移入コードです。

+0

完璧ですが、どうですか?私niewbie申し訳ありません、 – Acunamatata

+0

ここに? RicetteDetailViewController * ricetteDetailViewController = [[RicetteDetailViewController alloc] initWithNibName:@ "RicetteDetailViewController"バンドル:nil]; \t ricetteDetailViewController.mieRicette = [テーブルobjectAtIndex:indexPath.row]; \t self.navigationItem.title = [[table objectAtIndex:indexPath.row] nome]; \t [self.navigationController pushViewController:ricetteDetailViewController animated:YES]; } – Acunamatata

+0

はい、detailviewcontrollerを押す直前です。 –