2015-09-20 134 views
0

我是对的吗?我试图让我的项目,可以在所有不同的屏幕尺寸被使用,因为从时间我使用API​​创建17在其开头(歌Nexus One)适合所有屏幕尺寸

<supports-screens 
     android:smallScreens="true" 
     android:normalScreens="true" 
     android:largeScreens="true" 
     android:xlargeScreens="true" 
     android:anyDensity="true" /> 
    <application 
     android:allowBackup="true" 
     android:icon="@drawable/fitnessku" 
     android:label="@string/app_name" 
     android:largeHeap="true" 
     android:theme="@style/AppTheme" > 
     <compatible-screens> 
      <!-- all small size screens --> 
      <screen android:screenSize="small" android:screenDensity="ldpi" /> 
      <screen android:screenSize="small" android:screenDensity="mdpi" /> 
      <screen android:screenSize="small" android:screenDensity="hdpi" /> 
      <screen android:screenSize="small" android:screenDensity="xhdpi" /> 
      <!-- all normal size screens --> 
      <screen android:screenSize="normal" android:screenDensity="ldpi" /> 
      <screen android:screenSize="normal" android:screenDensity="mdpi" /> 
      <screen android:screenSize="normal" android:screenDensity="hdpi" /> 
      <screen android:screenSize="normal" android:screenDensity="xhdpi" /> 
      <!-- all large size screens --> 
      <screen android:screenSize="large" android:screenDensity="ldpi" /> 
      <screen android:screenSize="large" android:screenDensity="mdpi" /> 
      <screen android:screenSize="large" android:screenDensity="hdpi" /> 
      <screen android:screenSize="large" android:screenDensity="xhdpi" /> 
     </compatible-screens> 
+0

我看不到需要手动进行配置。只需将你的资产(图标,图像,布局,边界值等)添加到目录中,就像Yodism说的那样。 ;)进一步的信息:http://developer.android.com/guide/practices/screens_support.html –

回答

0

你需要为每个创建目录layout。将这些目录添加到您的layout文件夹以支持多种屏幕尺寸。

  • layout-small
  • layout-normal
  • layout-large
  • layout-xlarge
  • layout-xxlarge

不要忘记申报它manifest文件。

+0

不知道谁downvotes你的答案。 oO –

+1

是的。但是这个方法对我有用。 – Yodism