0
我已經編寫了自己的相機活動,我在FrameLayout
中展示了該照片的實時預覽,但實況圖像看起來並不自然,有點高,我認爲它是因爲FrameLayout
的尺寸與相機尺寸不符。我應該怎麼做才能解決它?Android:相機的尺寸與屏幕尺寸不匹配
這裏是相機活動的xml文件:
<?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" >
<FrameLayout
android:id="@+id/camera_preview"
android:layout_width="wrap_content"
android:layout_height="0dip"
android:layout_weight="0.86" />
<Button
android:id="@+id/button_capture"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:gravity="center"
android:onClick="capture"
android:text="Capture" />
<Button
android:id="@+id/button_accept"
android:layout_width="115dp"
android:layout_height="wrap_content"
android:text="Accept"
android:visibility="gone"
android:onClick = "accept" />
<Button
android:id="@+id/button_retake"
android:layout_width="107dp"
android:layout_height="wrap_content"
android:text="Retake"
android:visibility="gone"
android:onClick = "retake"/>
</LinearLayout>
沒有,已經從照相機拍攝的照片是好的,只是現場圖片在相機預覽中顯示(拍攝照片之前)有點高! – Navid777 2013-02-25 12:11:00
是你的代碼打開相機類似於: 意圖cameraIntent =新的意圖(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); getActivity()。startActivityForResult(cameraIntent,IMAGE_CAPTURE_REQUEST_CODE); – lokoko 2013-02-25 12:25:34
不,我寫了我自己的相機活動 – Navid777 2013-02-25 12:37:22