Xcodeで無限スクロールの背景を作りたいのですが、このコードを使用すると:
if (self.myAnimatedView.center.y < (self.view.bounds.size.height/4)) {
float difference = (self.view.bounds.size.height/4) - myAnimatedView.center.y;
score += (int)difference;
NSString *nssScore = [NSString stringWithFormat:@"%i", score];
scorelabel.text = nssScore;
myAnimatedView.center = CGPointMake(myAnimatedView.center.x, myAnimatedView.center.y - difference);
scorelabel.center = CGPointMake(scorelabel.center.x, scorelabel.center.y - difference);
b1.center = CGPointMake(b1.center.x, b1.center.y - (difference/2));
b2.center = CGPointMake(b2.center.x, b2.center.y - (difference/2));
if (b1.center.y > self.view.bounds.size.height - (b1.bounds.size.height/2)) {
b1.center = CGPointMake(b1.center.x, b2.center.y - 460);
}
if (b2.center.y > self.view.bounds.size.height - (b2.bounds.size.height/2)) {
b2.center = CGPointMake(b2.center.x, b1.center.y - 460);
}
float viewWidth = self.view.bounds.size.width;
float fViewWidthMinusPlatformWidth = viewWidth - 55.0f;
int iViewWidthMinusPlatformWidth = (int)fViewWidthMinusPlatformWidth;
}
これは、uiimageview が画面の 3/4 マークを通過すると、新しい背景が表示されるようにするためのものです。ただし、背景は変更されません。ここで何が機能していないか知っている人はいますか?前もって感謝します。