私は本当に配線された問題があり、解決方法はわかりません。私はUIButtonsフレームをアニメーション化しています。アニメーション化するときは、ボタンの画像をボタンと同じサイズに拡大します。それは私のiPhoneシミュレータで何もせずに動作します。しかし、私はそれをiPadのシミュレータで実行すると、画像のサイズは変わりません。いくつかの場所で[[gissaImg1 imageView] setContentMode:UIViewContentModeScaleToFill]コードを追加しましたが、それは役に立ちませんでした。UIButtonイメージのサイズ変更/縮尺を
何が問題なのか、この問題を解決する方法を知っていますか?
//Code to set the image
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@_small",
[[itemsForRound objectAtIndex:[[guessItems objectAtIndex:0] intValue]] valueForKey:@"Name"]]];
[self.gissaImg1 setImage:image forState:UIControlStateNormal];
[self.gissaImg1 setImage:image forState:UIControlStateHighlighted];
//Code to animate button
CGRect animateToSpot = (isIphone) ? CGRectMake(0, 0, 480, 320) : CGRectMake(0, 0, 1024, 768);
[self performSelector:@selector(PlayCorrectSound:) withObject:nil afterDelay:1];
[[gissaImg1 imageView] setContentMode:UIViewContentModeScaleToFill];
[UIView animateWithDuration:1.5 delay:0 options:(UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveLinear) animations:^{
switch (index) {
case 0:
[[gissaImg1 imageView] setContentMode:UIViewContentModeScaleToFill];
[self.gissaImg1 setFrame:animateToSpot];
[self.view bringSubviewToFront:gissaImg1];
break;
.......
はい、それは役に立ちました。ありがとう – Uffe
それは働く...ありがとう男 – eurica