2012-03-07 19 views
0

ビデオを録画するコードがあります。サーフェスビューを使用して、録画中のものを表示します。ここでの.xmlファイルです:垂直方向のビデオ録画時にオーバーレイを設定する

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
    <LinearLayout 
     android:orientation="horizontal" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
     <SurfaceView 
      android:id="@+id/videoview" 
      android:layout_width="720px" 
      android:layout_height="480px"/> 
     <Button 
     android:id="@+id/mybutton" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="REC" 
     android:textSize="12dp"/> 
     </LinearLayout> 
</LinearLayout> 

だから私は、それがどのように私は、デフォルトではなく、私ができる垂直に姿勢変化に隠されてしまうビューを含めるように指定したXMLを変更しますeven.t姿勢の変化であることを理解しますオーバーレイに対してsetVisibility(true)を実行します。 「録画垂直ビデオなし」の行に沿って何かを示す警告テキストを表示したい

答えて

2

ユーザーは、ユーザーがポートレートモードで対話できないようにするため、lock the orientation of the activityのように聞こえます。

そうでなければ、あなたがgetResources().getConfiguration().orientation

をチェックしてそう

public void onConfigurationChanged(Configuration newConfig) 
{ 
    super.onConfigurationChanged(newConfig); 
    if(newConfig.orientation ==Configuration.ORIENTATION_LANDSCAPE) 
    { 
    //something 
    } 

} 

とあなたのonCreateのようにあなたのonConfigurationChangedに隠されたオリエンテーションやキーボードが含まれており、向きに応じてビューの可視性を更新するために、あなたの活動のconfigchangesを設定することができます

関連する問題