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