benthebest Posted December 1, 2011 Share Posted December 1, 2011 Bonjour à tous :) Je débute en dev Android et voila, j'ai mon premier petit soucis ;) Donc, en fait, j'ai une première activité en mode verticale, séparée en 2 partie : - Haut (3/4 de l'écran) : une surfaceView pour y afficher la preview de la caméra - Bas (1/4 de l'écran) : 3 boutons de menu <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/layoutCamera" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="8" > <SurfaceView android:id="@+id/surfaceView" android:layout_width="fill_parent" android:layout_height="500px" android:layout_gravity="top" /> </LinearLayout> <LinearLayout android:id="@+id/layoutMenu" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" > <Button android:id="@+id/button1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="bottom" android:layout_weight="1" android:text="Play" /> <Button android:id="@+id/button2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="bottom" android:layout_weight="1" android:text="Pause" /> <Button android:id="@+id/button3" android:layout_width="0dp" android:layout_height="match_parent" android:layout_gravity="bottom" android:layout_weight="1" android:text="Rest Area" /> </LinearLayout> </LinearLayout> Jusque là c'est ok : cela fonctionne avec mes 3 boutons en bas et ma preview. Le hic c'est que malgré un android:screenOrientation="portrait" dans l'activité du manifeste, la preview de la camera s'affiche "penchée" de 90° !? Je ne sais pas vraiment d'ou cela vient, peut-être ai-je oublié quelque chose ? Merci de votre aide :) Link to comment Share on other sites More sharing options...
chpil Posted December 2, 2011 Share Posted December 2, 2011 Tu as une méthode setDisplayOrientation sur la classe Camera, qui te permet de choisir l'orientation de la prévisualisation de l'appareil photo Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.