다른 휴대 전화/태블릿 화면 크기에 맞춰 레이아웃을 지원할 때 몇 가지 문제가 있습니다. 내 레이아웃은 모든 화면에 맞지 않거나 크기가 조정되지 않습니다. 일부 화면 크기는 너무 많은 공간을 제공하고 다른보기에는 모든보기를위한 공간이 없습니다.다른 전화기 화면에서 내 레이아웃을 지원하는 데 사용해야하는 한정어는 무엇입니까?
PX와 밀도/크기/크기가 다른 한정자를 사용하여 다른 레이아웃을 생성하려고 시도했습니다. 하지만 모든 화면에 완전히 적응하려면 어떤 자격 조건을 사용해야하는지 알 수 없습니다. 뷰 높이에 맞게 dosn't :
이
내 레이아웃 (genymotion 에뮬레이터에서 테스트) 다른 화면480 픽셀 X 800 픽셀 240dpi (S3 미니)와 함께 작동 방법에 대한 설명입니다. X 800 픽셀 120DPI
480 픽셀 (에뮬레이터) : 조회수 높이
480 픽셀 X 800 픽셀 320dpi에 적합 dosn't : 뷰 주위 너무 많은 여유 공간.
600px x 1024px 240dpi : 완벽하게 피트!
600px x 1024px 420dpi : 아무것도 표시 할 공간이 거의 없습니다. 최대
1440px X 2560px 560dpi에서 아마 2-3 조회수 : 여유 공간이 조금
1440px X 2560px 640DPI : 딱 맞는!
1440px는 X 2560px 320DPI가 :
삼성 S3 MINI : 480 픽셀 X 800 픽셀 견해 여기
주위 너무 많은 여유 공간을 어떻게 배치 통계 다른 스크린 규모의 스크린 샷 예입니다 240dpi :https://www.dropbox.com/s/kvxggql80ivcmlp/galaxys3mini.png?dl=0
삼성 갤럭시 S7 : 1440px X 2560px 640DPI : 01,238,545,683,918,276,
넥서스 9 API (23)의 2048x1536 xhdpi는 :https://www.dropbox.com/s/r70h4da1xcf2lhi/nexus9.PNG?dl=0
어떻게 한정자를 사용한다 '?
레이아웃은 XML을 :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/arion_darkblue">
<TextView
android:id="@+id/stats_title"
style="@style/fragment_titles_style"
android:layout_alignParentTop="true"
android:text="Stats" />
<RelativeLayout
android:id="@+id/statsgroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/stats_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp">
<ImageView
android:id="@+id/stats_distance_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:background="@drawable/ic_stats_distance" />
<TextView
android:id="@+id/stats_distance_txt"
style="@style/fragments_textstyles"
android:layout_below="@id/stats_distance_img"
android:text="0,0 Km" />
<ImageView
android:id="@+id/stats_jump_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="35dp"
android:layout_toRightOf="@id/stats_distance_txt"
android:background="@drawable/ic_stats_jump" />
<TextView
android:id="@+id/stats_jump_txt"
style="@style/fragments_textstyles"
android:layout_below="@id/stats_distance_img"
android:layout_marginLeft="35dp"
android:layout_toRightOf="@id/stats_distance_txt"
android:text="00" />
<ImageView
android:id="@+id/stats_transition_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="65dp"
android:layout_toRightOf="@id/stats_jump_txt"
android:background="@drawable/ic_stats_transition" />
<TextView
android:id="@+id/stats_transition_txt"
style="@style/fragments_textstyles"
android:layout_below="@id/stats_distance_img"
android:layout_marginLeft="80dp"
android:layout_toRightOf="@id/stats_jump_txt"
android:text="00" />
<ImageView
android:id="@+id/stats_intensity_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_toRightOf="@id/stats_transition_img"
android:background="@drawable/ic_stats_intensity" />
<TextView
android:id="@+id/stats_intensity_txt"
style="@style/fragments_textstyles"
android:layout_below="@id/stats_distance_img"
android:layout_marginLeft="55dp"
android:layout_toRightOf="@id/stats_transition_txt"
android:text="0000" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/stats_symmetric_group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/statsgroup1"
android:layout_marginTop="50dp"
android:paddingLeft="30dp"
android:paddingRight="30dp">
<TextView
android:id="@+id/stats_sym_txt1"
style="@style/fragments_textstyles"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:text="50%" />
<ImageView
android:id="@+id/stats_symmertic_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/stats_sym_txt1"
android:background="@drawable/ic_stats_symmetric" />
<TextView
style="@style/fragments_textstyles"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/stats_symmertic_img"
android:text="50%" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true">
<TextView
android:id="@+id/stats_rotation_txt1"
style="@style/fragments_textstyles"
android:layout_alignParentLeft="true"
android:layout_marginRight="10dp"
android:text="50%" />
<ImageView
android:id="@+id/stats_rotation_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/stats_rotation_txt1"
android:background="@drawable/ic_stats_rotation" />
<TextView
android:id="@+id/stats_rotation_txt2"
style="@style/fragments_textstyles"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/stats_rotation_img"
android:text="50%" />
</RelativeLayout>
</RelativeLayout>
여러 개의 xml 레이아웃이 있습니까, 아니면 차이점이 있습니까? – abbath
@abbath 몇 가지 있지만, 지금은 모든 다른 화면에 맞게 하나의 레이아웃 만 얻으려고합니다. – Muddz
여기에 코드를 게시 할 수 있습니까? 어쩌면 정확한 xml 소스에 대해 제안 할 수있는 몇 가지 개선 사항이있을 수 있습니다. – abbath