Android 应用程序中的布局和可绘制问题
我经常对 Android 应用程序使用的图像大小和按钮大小感到困惑。
我知道按钮和图像必须放在 drawable
、drawable-ldpi
、drawable-mdpi
、drawable- 等文件夹中hdpi
、drawable-xhdpi
但我不清楚用于该应用程序的那些文件夹中提到的尺寸。
请帮我解释一下。例如,如果我在应用程序中使用背景图像,则默认图像的大小必须是多少,以及每个文件夹中要放置的大小是什么。
对于布局,我知道我必须使用 layout
、layout-large
、layout-small
、layout 等文件夹-xlarge
。例如,在此文件夹中,我有以下 xml 代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/splash_screen"
>
</LinearLayout>
对于每个布局的 android:background
图像,从哪个文件夹获取图像?
I am often getting confused with the image sizes and button sizes that I am using for the android app.
I know that the buttons and images must be placed in folders such as drawable
, drawable-ldpi
, drawable-mdpi
, drawable-hdpi
, drawable-xhdpi
but i am not clear the about the sizes to be mentioned in those folders that used for the app.
Please help me in explaining this. For example, if I am using a background image for my app, then what must be the size of the image in default and in each folder what sizes to be placed.
In case of the layout I know that I have to use folders such as layout
, layout-large
, layout-small
, layout-xlarge
. For example in this folder I am having the following xml code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/splash_screen"
>
</LinearLayout>
For the android:background
image for each layout, from which folder is the image fetched?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它会让你更好地理解...
http://developer.android.com/guide /practices/screens_support.html
it will give you a better understanding...
http://developer.android.com/guide/practices/screens_support.html