2012-10-16 4 views
0
res/layout/main_activity.xml   
res/layout-small/main_activity.xml 
res/layout-large/main_activity.xml 
res/layout-xlarge/main_activity.xml 
res/layout-xlarge-land/main_activity.xml 

이름이 같지만 텍스트 메시지가 다른 두 개의 레이아웃 파일이 있습니다. 내 응용 프로그램을 Samsung-Galaxy 10.1 or Google Nexus 7 인치 태블릿 또는 내 에뮬레이터에서로드하려고 할 때 내 밀도가 1024dp * 600dp 인 경우 항상 res/layout/main_activity.xml을로드합니다.Android에서 크기가 다른 레이아웃을 다르게 설정하는 경우

여기에서 내가 실수를하고 있는지 확실하지 않습니다. 아래는 매니페스트 파일입니다.

<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.sample" 
    android:versionCode="2" 
    android:versionName="2.3.4" > 

    <uses-sdk 
     android:minSdkVersion="11" 
     android:targetSdkVersion="15" /> 

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


    <application 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" > 
     <activity 
      android:name=".Splash" 
      android:label="@string/title_activity_splash" 
      > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

     <activity 
      android:name=".Trial" 
      android:label="@string/title_activity_trial" 
      android:exported="false" 
      > 
      <intent-filter> 
       <action android:name="com.sample.TRIAL" /> 
       <category android:name="android.intent.category.DEFAULT" /> 
      </intent-filter> 
     </activity> 

    </application> 

</manifest> 

그리고 4.1.1.4 버전의 android.jar를 사용하고 있습니다.

<dependency> 
     <groupId>com.google.android</groupId> 
     <artifactId>android</artifactId> 
     <version>4.1.1.4</version> 
     <scope>provided</scope> 
    </dependency> 
+0

상태 표시 줄 (전원, 수신 등)이 화면 공간을 차지합니다. 따라서 해상도가 800x600 인 경우 600이 아니라 550이됩니다. 따라서 sw-550dp를 사용하십시오. 너비에 영향을 미치지는 않지만 'sw'것을 확인하십시오. – Shark

+0

@Shark : 이제 폴더 이름을 다르게 업데이트했습니다. 확인해주세요. – theJava

+0

모든 레이아웃 폴더를 '한정'해야합니다. layout-h400dp 및 layout-h1000dp와 같이 가장 작은 사양으로 기본값을 지정하십시오. – Shark

답변

0

this chart에 따르면, 1024 × 600이 xlarge로 분류된다. <support-screens> 태그에 xlarge가 언급되지 않았습니다.

관련 문제