Android上的多屏支持

问题描述

| 从最近几天开始,我试图创建一个可以根据模拟器的尺寸变化来调整屏幕的应用程序。我找到了使用多屏幕的解决方案。 但我无法做到这一点 我已从中寻求帮助,但无法理解我如何
setContentView(R.layout.main);
?因为当我在
R
之后按。(点)时,它不会向我显示以下文件夹.. :( 我已经在Android应用程序的the5ѭ文件夹下创建了3个文件夹,分别为
layout-large
layout-small
layout-large-land
我已将其添加到清单文件中。
<supports-screens
          android:largeScreens=\"true\"
          android:normalScreens=\"true\"
          android:smallScreens=\"true\"       
          android:anyDensity=\"true\" />
在这里错过了什么?我正在使用android 1.6预先感谢 问题是我是否还必须将此
main.xml
文件提供给认的
layout folder
文件?是的,然后对屏幕尺寸的变化没有影响,否,然后我强制使用了
API level 7
,它强制关闭了我的应用程序,但问题仍然存在 这是我的xml文件
<?xml version=\"1.0\" encoding=\"utf-8\"?>



<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"
    android:layout_width=\"fill_parent\" android:id=\"@+id/rl\"
    android:layout_height=\"360dip\">
    <!--
        <WebView android:id=\"@+id/webviewHelp\"
        android:layout_width=\"fill_parent\"
    -->
    <!--        android:layout_height=\"fill_parent\" />-->
    <WebView android:id=\"@+id/webviewHelp\" android:layout_width=\"fill_parent\"
        android:layout_height=\"fill_parent\" />
    <Button android:id=\"@+id/My_btn\"
        android:layout_alignParentBottom=\"true\"
        android:layout_alignParentLeft=\"true\" android:gravity=\"center\"
        android:textSize=\"8px\" android:text=\"Download this mp3 file\"
        android:textColor=\"@color/white\" android:layout_width=\"fill_parent\"
        android:layout_height=\"28dip\" android:visibility=\"invisible\" />
    <Button android:id=\"@+id/My_btn1\"
        android:layout_alignParentBottom=\"true\"
        android:layout_alignParentLeft=\"true\" android:text=\"this is button !\"
        android:layout_width=\"0dip\" android:layout_height=\"0dip\"
        android:visibility=\"invisible\" />


</RelativeLayout>
    

解决方法

        请在这些文件夹中添加一些布局xml,然后再在R之后输入点号:) 文件夹本身不会生成资源ID,但是其中的xml文件会生成资源ID。     ,        我不确定这就是您的意思,但这对我有用: ScalingLinearLayout