Android 支持多个分辨率和多个布局文件夹 [英] Android supporting multiple resolution with multiple layout folder
问题描述
现在我支持多个分辨率和多个布局文件夹.我正在使用 android 开发工作室,我制作了 3 个不同的文件夹.
Now I'm supporting multiple resolution with multiple layout folders. I'm using android development studio and I made 3 different folders.
layout
layout-large-port-1280x720
layout-normal-port-800x480
我在 800x480 和 1280x720 上进行了测试.480x800 运行良好,但 1280x720 遵循 800x480 文件夹的 dp 和 UI.
and I tested on 800x480 and 1280x720. 480x800 worked well, but 1280x720 follow 800x480 folder's dp and UI.
我不知道为什么这件事会发生在我身上,我也不知道如何解决这个问题.为什么它不起作用,我该怎么办?
I don't know why this thing happens to me and I don't know how to solve the problem. Why it doesn't work and what should I have to do?
推荐答案
对于不同的屏幕尺寸,以下是一个应用程序中的资源目录列表,为不同的屏幕尺寸提供不同的布局设计,为小、中型提供不同的位图可绘制、高密度和超高密度屏幕.
For Different screen size, The following is a list of resource directories in an application that provides different layout designs for different screen sizes and different bitmap drawables for small, medium, high, and extra high density screens.
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
Manifest 中的代码支持所有 dpi.
Thats code in the Manifest supports all dpis.
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true" />
这篇关于Android 支持多个分辨率和多个布局文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!