スマホ回転の制御

スマホを回転させた時、作成した WebView 表示の向きが回転しないように制御する方法

AndroidManifest.xml の中、activity で、android:screenOrientation="nosensor"
を追加する。

<activity android:name=".SampleActivity"
         android:label="@string/app_name"
          android:screenOrientation="nosensor">


iPhone UIWebView の場合、ViewController に以下のメソッドを追加

-(BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)interfaceOrientation{
   return NO;
}