• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

自分の view が表示される前に別のタブで回転されている可能性があるので、回転に対応する処理をプログラムで行う場合は viewWillAppear の中でも処理を行わなくてはならない。

ruby>>
@implementation SomeViewController

  • (BOOL)
    shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
    }

  • (void)
    AdjustHV {
    switch ( self.interfaceOrientation ) {
    case UIInterfaceOrientationPortrait:
    case UIInterfaceOrientationPortraitUpsideDown:
    oV1.frame = CGRectMake(
    0
    , 0
    , self.view.frame.size.width
    , self.view.frame.size.height / 2
    );
    oV2.frame = CGRectMake(
    0
    , self.view.frame.size.height / 2
    , self.view.frame.size.width
    , self.view.frame.size.height / 2
    );
    break;
    case UIInterfaceOrientationLandscapeLeft:
    case UIInterfaceOrientationLandscapeRight:
    oV1.frame = CGRectMake(
    0
    , 0
    , self.view.frame.size.width / 2
    , self.view.frame.size.height
    );
    oV2.frame = CGRectMake(
    self.view.frame.size.width / 2
    , 0
    , self.view.frame.size.width / 2
    , self.view.frame.size.height
    );
    break;
    }
    }

  • (void)
    viewWillAppear:(BOOL)p {
    [ super viewWillAppear:p ];
    [ self AdjustHV ];
    }

  • (void)
    willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)p
    duration:(NSTimeInterval)pDuration {
    [ super willAnimateRotationToInterfaceOrientation:p duration:pDuration ];
    [ self AdjustHV ];
    }
    @end
    <<--

posted by Saturn Saturn on Wed 17 Nov 2010 at 10:00 with 0 comments
Contents rssrss
Value Transformer
AES & Blowfish in swift (CBC)
OreOre.pem の作り方
JSON Chat Server Skelton in GoLang TLS Ver.
JSON Chat Server Skelton in GoLang
UITextView と、UITextField でキーボードが出た時の Notification の順番が違う
Making window which covers iPhone's Status Bar
UIImagePickerController の編集領域
UIView の tag property
UILocationManager
Services from s21g
MagicBag
MagicBagは、Cloudflare R2やS3互換ストレージをMacのFinderから扱えるファイル同期クライアントです。
アンテナショップめぐり
東京にある全国のアンテナショップ、イベント、特産品を地図や条件から探せるサービスです。
YOMU Web小説リーダー
YOMUは、Web小説の読み上げに特化したiPhoneアプリです。
補助探
公開されている補助金・助成金情報を集約し、条件に合う制度を探しやすくするサービスです。
jotter.me
jotter.meは、考えやアイデア、情報を書き留めるためのノートサービスです。