我开发了一个应用程序。我开发的尺寸是3.7in WVGA Nexus One。java代码如何支持多屏大小
所以,当显示比这个屏幕大,它没有问题。当我显示小于3.7in时,出现了问题。
这里是我的XML,我使用固定PX一些部件。
<LinearLayout
android:id="@+id/layout_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/layout_title"
android:background="@drawable/backrepeat"
android:gravity="center_vertical|center_horizontal" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal" >
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal" >
<TableRow
android:layout_width="fill_parent"
android:gravity="center_vertical|center_horizontal"
android:paddingBottom="10px"
android:paddingTop="10px" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal" >
<TextView
android:id="@+id/fixtext_name"
android:layout_width="80px"
android:layout_height="wrap_content"
android:gravity="right"
android:paddingBottom="10px"
android:text="姓名 :"
android:textColor="#000000"
android:textSize="30px" />
<EditText
android:id="@+id/text_name"
android:layout_width="400px"
android:layout_height="wrap_content"
android:ems="15"
android:gravity="left"
android:inputType="textPersonName"
android:paddingBottom="10px"
android:textSize="30px" >
</EditText>
</LinearLayout>
</TableRow>
</TableLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
这是我的应用程序布局的一个例子。总宽度为480像素,并使用高度
FILL_PARENT
所以,高度不会有问题。
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:requiresSmallestWidthDp="480"
android:compatibleWidthLimitDp="480"
android:largestWidthLimitDp="480" >
</supports-screens>
这是manifest xml中的支持屏幕属性。我已经设定好了。
问题是当我显示在2.7in QVGA(类似SG Mini),它只显示240px宽度而不是全屏项目。
我想问拿捏或应用程序屏幕大小调整大小应用基地?
如果可以,我需要为所有的活动代码是一回事吗?
这意味着我得到20 xml还需要创建一个适合小尺寸的新的?例如,原来我有a.xml和b.xml,然后我需要为small_a.xml和small_b.xml创建一个新的。里面的一个也需要完全复制而不改变 –
新的布局需要放到res/layout文件夹中? –
java类怎么样?如果没有实现,应用程序如何确定使用哪个文件夹? –