0

私は iOS 開発の新人で、iPad と iPhone の両方でさまざまな向きを扱う初めてのアプリです。

これがシナリオです。向きを処理するためにこの関数を実装しましたが、うまくいきました。

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

しかし、別のページに移動して向きを変更し (例: 横向き)、最初のページ (例: まだ横向きモード) に戻ると、UIImage の背景はもう変更されません..

どんな答えでも本当に感謝します、ありがとう

4

1 に答える 1

0
  • (NSInteger)supportedInterfaceOrientations { [self performSelector:@selector(setImageFrame)];

    UIInterfaceOrientationMaskAll を返します。}

  • (BOOL)shouldAutorotate { [self performSelector:@selector(setImageFrame)];

    はいを返します。}

  • (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { [self performSelector:@selector(setImageFrame)];

    はいを返します。}

または、 xib を使用している場合は autorisizing マスクを確認するか、すべて lbltitle.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | のように設定します。UIViewAutoresizingFlexibleWidth ....

于 2013-02-05T10:21:20.067 に答える