I am trying to use only a small portion of th开发者_开发百科e screen to display the view from the camera.
Here is my XML file.
<?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:background="@drawable/backimage" android:orientation="horizontal">
<android.view.SurfaceView android:id="@+id/preview"
android:layout_width="fill_parent" android:layout_height="100dp"/>
</LinearLayout>
This code runs on my phone, however, I do not see anything from the camera.
I do see the input from the camera when I use this XML
<android.view.SurfaceView android:id="@+id/preview"
android:layout_width="fill_parent" android:layout_height="fill_parent"/>
</LinearLayout>
Should I use another type of object to display a smaller view of the camera ?
精彩评论