2011-05-13 3 views
5

내 응용 프로그램에는 3 가지 다른 레이아웃 폴더가 있습니다.Android는 사용할 레이아웃 폴더를 어떻게 결정합니까?

layout 
layout-large 
layout-xlarge 

here을 설명하는 사용 가능한 Android 장치 화면에 따라이 작업을 수행했습니다. 그래서 인치로 표시되는 화면 크기는 사용할 레이아웃 폴더를 결정하는 데 사용되는 유일한 것입니다. 그러나 다양한 7 인치 에뮬레이터를 사용한 최근의 테스트에서 때때로 layout 폴더와 layout-large 폴더가 사용되는 경우가있었습니다. 그래서 다른 어떤 요소가 사용되는지 말해 줄 수 있습니까?

답변

1

인치 크기가 중요하다고 생각합니다. 누군가가 7 인치 장치의 올바른 레이아웃 폴더에서 에뮬레이터를 고르려고 시도하면서 이상한 결과를 낳는 경우에 대한 질문이 여기에있었습니다. 나는 Galaxy 탭을 가지고 있는데, 항상 layout-large, 또는 layout-hdpi를 취할 것입니다.

편집 :이 화면 픽셀 수의 유형을 보인다 아마도 내가 잘못했다, 너무 문제가 있습니다 -

* small: Screens based on the space available on a low-density QVGA screen. Considering a portrait HVGA display, this has the same available width but less height—it is 3:4 vs. HVGA's 2:3 aspect ratio. The minimum layout size for this screen configuration is approximately 320x426 dp units. Examples are QVGA low density and VGA high density. 
* normal: Screens based on the traditional medium-density HVGA screen. A screen is considered to be normal if it is at least this size (independent of density) and not larger. The minimum layout size for this screen configuration is approximately 320x470 dp units. Examples of such screens a WQVGA low density, HVGA medium density, WVGA high density. 
* large: Screens based on the space available on a medium-density VGA screen. Such a screen has significantly more available space in both width and height than an HVGA display. The minimum layout size for this screen configuration is approximately 480x640 dp units. Examples are VGA and WVGA medium density screens. 
* xlarge: Screens that are considerably larger than the traditional medium-density HVGA screen. The minimum layout size for this screen configuration is approximately 720x960 dp units. In most cases, devices with extra large screens would be too large to carry in a pocket and would most likely be tablet-style devices. Added in API Level 9. 

당신이 레이아웃 큰 MDPI 등이이 같은 하나 이상의 규정에 폴더가 일어날 경우 우선 순위에주의를 기울이십시오. this page 도움이 될 것입니다.

+0

+1 감사합니다. 스크린에 대한 설명은 어디서 얻었습니까? 나는 그것을 읽고 싶다. – RoflcoptrException

+1

내 대답의 맨 아래에 링크 된 페이지의 테이블에 있습니다. – FoamyGuy

3

7 인치 Android 태블릿은 HDPIlarge입니다.

xlarge은 만들어진 시점에 존재하지 않았고, 그들 중 대부분은 픽셀 밀도를 가지고 있지만, 더 나은 외모 때문에 주위 160 (MDPI) 그들은 HDPI 장치로 자신을 제시한다.

그래서 7inch 태블릿은 자원 시스템에 제대로 적합하지 않습니다. 3.0 이전에는이를 적용 할 방법이 없었기 때문에 새로운 화면 크기 한정자가 도입되었습니다.

관련 문제