Android资源大小限定符可以';不能由某些设备来决定
根据设计,我有两张图片:屏幕高度小于600dp的设备和其他设备。我在Android资源大小限定符可以';不能由某些设备来决定,android,android-resources,Android,Android Resources,根据设计,我有两张图片:屏幕高度小于600dp的设备和其他设备。我在drawable-h600dp和drawable文件夹中为此图片创建了两个xml文件 drawable-h600dp/logo.xml的内容: <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/logo_b
drawable-h600dp
和drawable
文件夹中为此图片创建了两个xml文件
drawable-h600dp/logo.xml的内容
:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/logo_big" />
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/logo_small" />
此解决方案适用于大多数设备。但一些设备,如LG Nexus5(640dp高度)和摩托罗拉RAZR HD(640dp高度)显示的是小画面而不是大画面。我从“ScreenInfo”google play应用程序中获取设备屏幕高度(dp)
只有纵向配置,横向设置被禁用
有没有办法正确地确定资源的屏幕高度