1

在我的基于 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 清单.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>

编辑 图像视图显示

 {
     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>'
 }

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

4

0 回答 0