2011-07-25 6 views
0

で2 uiimageViewを置く私のコードです:は、ここで背景

-(void)transition{ 
CATransition *applicationLoadViewIn = [CATransition animation]; 
[applicationLoadViewIn setDuration:2]; 
[applicationLoadViewIn setType:kCATransitionFade]; 
[applicationLoadViewIn setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]]; 
[[self.view layer] addAnimation:applicationLoadViewIn forKey:kCATransitionFade]; 
    imgView2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bluefont.png"]];   


if(self.view.layer.sublayers.count<=2) 

{ 
    [[[self view] layer] addSublayer:[imgView2 layer]]; 
} 
else { 

    [[self.view.layer.sublayers lastObject] removeFromSuperlayer]; 
} 

[imgView2 release]; 
} 


- (void)viewDidLoad { 
[super viewDidLoad]; 
     imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"pinkfont.png"]];   
[[[self view] layer] addSublayer:[imgView layer]]; 
    [imgView release]; 
[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(transition) userInfo:nil repeats:YES]; 

}

私は、このように背景が青とピンクのcolour.Howの間で変更され、背景にimgView2とimgViewを送りたいです私はこれをしてもらえますか?申し訳ありませんが私の英語のために、私はフランス人だ:/

答えて

0

フレームを使用して、あなたが達成することができます背景画像の名前を変更することによりそれが

self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"image.png"]]; 

有用である可能性が背景

+0

コードで説明できるのか分かりませんか? –

+0

誰でも私に返答できますか? –

+0

image1.frame = cgrectmake(0,0,320,160); image2.frame = cgrectmake(0,160,320,160); – Tendulkar

0

に2 imageviewsを追加することができます。

関連する問題