我已经在布局文件夹中创建android布局我的设备英寸是从3.2到5英寸,它在正常屏幕下方,仅针对此设备,但我的布局在3.2中互不相同和4英寸。android正常布局屏幕不适用于所有正常屏幕
回答
你可以得到屏幕大小有问题在Java中,使检查
请遵循:Supporting multiple screen size - Android
定义一样,
res/values-sw600dp/dimen.xml -> 7+ inches
res/values-sw720dp/dimen.xml -> 10+ inches
values-w360dp
values-w500dp
values-w480dp
values-xlarge
values-v11
values-v14
Sherlock Bar检查有
可以给你一些链接我 – user3415586
访问那个http:// stackoverflow。com/questions/9476662/how-to-set-android-layout-to-support-all-screen-sizes –
res/layout/my_layout.xml //正常屏幕尺寸(“默认”)的布局... 3.2之间4.7英寸正常默认布局下只有..我正在使用imageview,webview,google添加线性布局 – user3415586
res/layout/my_layout.xml // layout for normal screen size ("default")
res/layout-small/my_layout.xml // layout for small screen size
res/layout-large/my_layout.xml // layout for large screen size
res/layout-xlarge/my_layout.xml // layout for extra large screen size
res/layout-xlarge-land/my_layout.xml // layout for extra large in landscape orientation
res/drawable-mdpi/my_icon.png // bitmap for medium density
res/drawable-hdpi/my_icon.png // bitmap for high density
res/drawable-xhdpi/my_icon.png // bitmap for extra high density
res/layout/my_layout.xml //正常屏幕尺寸的布局(“默认”)我只使用这种布局,想要支持从3.2英寸到4.7英寸的放置对齐从彼此变化 – user3415586
@ user3415586是] – duggu
我能做些什么来解决这个问题问题 – user3415586
您需要为其创建不同的文件夹该
例如
布局文件夹/ main.xml中
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical" >
<Button
android:id="@+id/rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Rate us"
android:textColor="@color/black_font" />
</RelativeLayout>
布局大/ main.xml中
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical" >
<Button
android:id="@+id/rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Rate us"
android:textColor="@color/black_font"
android:textSize="30sp" />
</RelativeLayout>
布局XLARGE /主.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical" >
<Button
android:id="@+id/rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Rate us"
android:textColor="@color/black_font"
android:textSize="60sp" />
</RelativeLayout>
欲了解更多信息,请参阅this link
对于您的问题,您需要通过密度低的密度(LDPI)的屏幕
ldpi
资源来创建它(〜120DPI)。mdpi
中密度(mdpi)屏幕资源(〜160dpi)。 (这是基准密度。)hdpi
高密度(hdpi)屏幕资源(〜240dpi)。xhdpi
超高密度(xhdpi)屏幕资源(〜320dpi)。nodpi
所有密度的资源。这些是密度无关的资源。无论当前屏幕的密度如何,系统都不会缩放使用此限定符标记的资源。tvdpi
屏幕资源介于mdpi和hdpi之间;大约213dpi。这不被视为“主要”密度组。它主要用于电视,大多数应用程序都不需要它 - 为大多数应用程序提供mdpi和hdpi资源已足够,系统会根据需要对其进行扩展。如果您发现有必要提供tvdpi资源,则应该将其大小设置为1.33 * mdpi。例如,mdpi屏幕的100px x 100px图像对于tvdpi应为133px x 133px。
res/layout/my_layout.xml //正常屏幕尺寸(“默认”)的布局... 3.2至4.7之间英寸只有正常的默认布局..我正在使用图像eview,webview,谷歌添加线性布局 – user3415586
- 1. 布局不适合所有屏幕
- 2. 布局不适合屏幕
- 3. 适用于所有屏幕尺寸的Android xml布局
- 4. 屏幕分辨率。全屏 - 完美。正常屏幕 - 不完美
- 5. Xamarin Studio iOS应用程序中的屏幕布局不正常
- 6. 针对正常屏幕尺寸的Android布局设计
- 7. android表格布局不适合屏幕
- 8. Android布局不适合屏幕
- 9. 所有屏幕尺寸的Android常见布局
- 10. 正常屏幕上的宽屏检查
- 11. 大 - 正常在多个屏幕的Android
- 12. 不能正常调暗屏幕
- 13. 碰撞屏幕不能正常工作
- 14. 飞溅屏幕不能正常工作
- 15. 屏幕左侧不能正常工作
- 16. 的Android单个布局,以适应所有屏幕尺寸
- 17. 屏幕尺寸不适合屏幕,因为它通常会
- 18. Android布局多屏幕
- 19. Android,布局屏幕宽度
- 20. Android:多屏幕布局
- 21. Android:布局“滑动”屏幕?
- 22. 表格布局不适合屏幕
- 23. 我怎样才能使布局小于3“屏幕和布局4.8”屏幕(android)
- 24. 布局Android TextView相对于屏幕
- 25. Android根据屏幕尺寸不使用正确的布局
- 26. 布局不适应所有屏幕尺寸
- 27. Android:不同屏幕的不同布局
- 28. OpenGL屏幕布局
- 29. 加载屏幕无法正常工作
- 30. Win32异常正在屏幕截图[c#]
我只针对正常屏幕不小,大,他们将只是正常的屏幕...在linearlayout使用webview,图像和谷歌广告3.2和4英寸只在正常屏幕下 – user3415586