Android activity won't fill WVGA screen

瘦欲@ 提交于 2019-12-07 07:56:49

问题


I'm developing an Activity with a simple LinearLayout with a button. When I try the activity on my hardware (WVGA 480x800 screen) the activity only fills the standard size (480x320) while the OS itself fills the whole screen.

What could be the issue.

Thanks,

<?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="#FFF"                    android:fitsSystemWindows="true">  
        <Button android:text="@+id/Button01" android:id="@+id/Button01"                          android:layout_width="wrap_content" 
                android:layout_height="wrap_content"></Button>
</LinearLayout>

回答1:


I believe you have to specify in the manifest file that you want to allow the application to scale to the size of a larger screen.

See: http://developer.android.com/guide/practices/screens_support.html#attrs for more info.

There is a part about <supports-screens> attribute in the manifest that might have what you are looking for.



来源:https://stackoverflow.com/questions/2510354/android-activity-wont-fill-wvga-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!