屏幕尺寸问题与Galaxy s5和Note 4与getPicture API

时间:2014-11-06 20:55:52

标签: android android-layout cordova ibm-mobilefirst samsung-mobile

我有一个Worklight混合应用程序,除了较新的Galaxy S5和Note 4外,大多数设备都可以正常使用。

该应用在所有设备中都能正常显示,但它使用Cordova相机插件来获取现有照片。但是,三星有一个目录选择器"获取图片"在文件选择器之前。对话框太大而无法使用。

我已尝试将anyDensity设置为false,但这会导致应用的内容很小,尽管对话框看起来不错。我还尝试使用targetSdkVersion=13android:xlargeScreensandroid:compatibleWidthLimitDpandroid:largestWidthLimitDp
android:requiresSmallestWidthDp并在CSS中更改@media查询而没有运气。

我能做些什么来让我的应用看起来一样但调整系统对话框以便正确处理它自己?

工作灯6.2
android 4.4.4
cordova 3.6
backbone,jQuery,less

    <supports-screens android:anyDensity="false"   android:normalScreens="true"    android:resizeable="false" android:smallScreens="false"/>  

enter image description here

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="5" android:versionName="1.0" package="com.EmployeeApp">
    <uses-sdk android:minSdkVersion="8" />  

    <supports-screens android:anyDensity="false"   android:normalScreens="true" android:resizeable="false" android:smallScreens="false"/>  
    <uses-permission android:name="android.permission.INTERNET"/>  
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>  
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>  
    <!-- Push permissions -->  
    <permission android:name="com.EmployeeApp.permission.C2D_MESSAGE" android:protectionLevel="signature"/>  
    <uses-permission android:name="com.EmployeeApp.permission.C2D_MESSAGE"/>  
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>  
    <uses-permission android:name="android.permission.WAKE_LOCK"/>  
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>  
    <uses-permission android:name="android.permission.USE_CREDENTIALS"/>  
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>  
    <application android:icon="@drawable/icon" android:label="@string/app_name"> 
        <activity android:configChanges="orientation|keyboardHidden|screenSize"  android:label="@string/app_name" android:launchMode="singleTask" android:name=".EmployeeApp">  
            <intent-filter> 
                <action android:name="android.intent.action.MAIN"/>  
                <category android:name="android.intent.category.LAUNCHER"/> 
            </intent-filter>  
            <intent-filter> 
                <action android:name="com.EmployeeApp.EmployeeApp.NOTIFICATION"/>  
                <category android:name="android.intent.category.DEFAULT"/> 
            </intent-filter> 
        </activity>  
        <!-- Preference Activity  -->  
        <!-- Removed preferences activity per defect 20086 -->  
        <!--activity android:name="com.worklight.common.WLPreferences" android:label="Worklight Settings"/-->  
        <!-- Push service  -->  
        <!-- In order to use the c2dm library, an application must declare a class with the name C2DMReceiver, in its own package, extending com.google.android.c2dm.C2DMBaseReceiver 
            It must also include this section in the manifest, replacing "com.google.android.apps.chrometophone" with its package name. -->  
        <service android:name=".GCMIntentService"/>  
        <service android:name=".ForegroundService"/>  
        <!-- Only google service can send data messages for the app. If permission is not set - any other app can generate it -->  
        <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"> 
            <!-- Receive the actual message -->  
            <intent-filter> 
                <action android:name="com.google.android.c2dm.intent.RECEIVE"/>  
                <category android:name="com.EmployeeApp"/> 
            </intent-filter>  
            <!-- Receive the registration id -->  
            <intent-filter> 
                <action android:name="com.google.android.c2dm.intent.REGISTRATION"/>  
                <category android:name="com.EmployeeApp"/> 
            </intent-filter> 
        </receiver> 
    </application> 
</manifest>

1 个答案:

答案 0 :(得分:1)

根据我的评论:尝试将targetSdkVersion更改为高于尝试的“14”,而不是19或20。

通常使用更高的API级别,这会告诉系统使用更适合所用操作系统的UI元素。 API越低,与更新的OS版本,屏幕尺寸等的兼容性越低。