相机拍摄始终以横向模式显示

时间:2013-11-04 10:06:46

标签: android cordova camera

在我基于phonegap 2.9.0的应用程序中,我已经包含并使用了基于相机的插件。当我捕捉照片时,它显示始终处于横向模式。当我从图库中选择照片时,它正确显示。这里是代码

function capturePhoto()
{
    navigator.camera.getPicture(onPhotoURISuccess,fail, {
    quality: 50,
    allowEdit: true,
    destinationType:Camera.DestinationType.FILE_URI
 }
 );
}
function getPhoto() 
{
 navigator.camera.getPicture(onPhotoURISuccess, fail,
 {
  quality: 50,
  destinationType: navigator.camera.DestinationType.FILE_URI,
  sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
  allowEdit:true,
 });
}

Android Manifest.XML

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.globas.wishlist"
android:hardwareAccelerated="true"
android:versionCode="1"
android:versionName="1.0"
android:windowSoftInputMode="adjustNothing" >
<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true"
    android:xlargeScreens="true" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<application 
    android:debuggable="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/logo"
    android:label="@string/app_name" >
    <activity
        android:name="wishlist"
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Black.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
 </application>
 <uses-sdk android:minSdkVersion="8" />
 </manifest>

修改  Imageview显示

 {
     xtype: 'panel',
     height:'100px',
     docked: 'bottom',
     html:'<div align="center" style="padding-top:15px"><img src="resources/img/icon2.png" id="myproductpic" height="70" width="90" /></div>'
 }

我的代码出了什么问题。请帮我解决问题。

0 个答案:

没有答案