android 인터페이스를 디자인 할 때 초기 캔버스의 크기는 얼마입니까? 모든 종류의 화면에 호환되는 레이아웃을 만들고 싶습니다. 특정 대규모 디자인에서 시작하여 그곳으로 확장 할 수 있습니까? 즉 960x720?안드로이드 인터페이스를 디자인 할 때 초기 캔버스의 크기는 얼마입니까?
0
A
답변
2
당신은 화면 크기를 얻을 시도 할 수 있습니다 :
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
와 방향 :
public int getScreenOrientation() {
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
return 1; // Portrait Mode
}else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
return 2; // Landscape mode
}
return 0;
}
0
시도 레이아웃 픽셀의 수정 양을 피하기 위해. 파 예를 들어,이 코드는 화면과 같은 폭으로 두 개의 버튼, 각각의 절반을 그릴 것입니다 :
<LinearLayout
android:id="@+id/Tab1_Buttonline1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/function_datasync"
android:layout_width="wrap_content"
android:text="Daten Sync"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="5dip"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:maxLines="1">
</Button>
<Button
android:id="@+id/function_docsync"
android:layout_width="wrap_content"
android:text="Datei Sync"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="5dip"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:maxLines="1">
</Button>
</LinearLayout>
또한 드로어 블-hdpi에/-mdpi 또는 -ldpi foders를저기서에 의해 서로 다른 해상도에 대해 서로 다른 레이아웃을 정의 할 수 있습니다, 서로 다른 드로어 블을 정의 할 수 있습니다.
컨트롤의 특정 높이 또는 무게를 사용하도록 강요당한 경우 (예 :
android:layout_margin="5dip"
"딥"때문에 여백이 모든 해상도에서 비슷하게 나타납니다.
관련 문제
- 1. HTML 캔버스의 최대 크기는 얼마입니까?
- 2. C#의 ArrayList의 초기 크기는 얼마입니까?
- 3. 파일을 복사해야하는 크기는 얼마입니까?
- 4. MySQL의 정확한 크기는 얼마입니까?
- 5. PNG 파일의 크기는 얼마입니까?
- 6. 쿠키의 최대 크기는 얼마입니까?
- 7. Seam의 세션 크기는 얼마입니까?
- 8. BufferedReader의 버퍼 크기는 얼마입니까?
- 9. PHP에서 bool의 크기는 얼마입니까?
- 10. 클래스의 일부로 선언 할 때 ValueType의 크기는 얼마입니까?
- 11. 최대 Android 애플리케이션 크기는 얼마입니까?
- 12. 이중 포인터 문자열의 크기는 얼마입니까?
- 13. Linux의 대기열 대기열 크기는 얼마입니까?
- 14. JVM에서 처리 할 수있는 최대 파일 크기는 얼마입니까?
- 15. UITableViewCell에서 UIImage의 기본 크기는 얼마입니까?
- 16. 도쿄 캐비닛의 최대 크기는 얼마입니까?
- 17. MySQL 데이터베이스의 최대 크기는 얼마입니까?
- 18. Plone 4 데이터베이스의 크기는 얼마입니까?
- 19. SqlBulkCopy의 권장 배치 크기는 얼마입니까?
- 20. SockJS 메시지의 최대 크기는 얼마입니까?
- 21. UINavigationBar titleView의 최대 크기는 얼마입니까?
- 22. H4의 기본 글꼴 크기는 얼마입니까?
- 23. 패싯의 특수 문자의 크기는 얼마입니까?
- 24. C의 배열 최대 크기는 얼마입니까?
- 25. EWS에서 ItemView의 최대 크기는 얼마입니까?
- 26. Android 앱용으로 만드는 크기는 얼마입니까?
- 27. 시스템 트레이의 아이콘 크기는 얼마입니까?
- 28. UITabBarItem 이미지의 최대 크기는 얼마입니까?
- 29. AVCaptureVideoPreviewLayer 콘텐츠의 범위/크기는 얼마입니까?
- 30. 윈도우 세마포어 객체의 크기는 얼마입니까?