How to make application scale to large (tablet) sc

2020-08-05 10:55发布

问题:

I'm just getting into developing on Android and want to try my hand at developing a Tablet app. The problem is, no matter what I've tried so far, deploying the app results in a scaled down version of the app, running at the top of the screen. It appears about the size of a mobile app, and the rest of the screen is just blank.

How can I make my the application recognize that it's on a tablet and scale the screen up?

I've tried changing the screen size in the layout XML WYSIWYG editor, but am to no avail.

回答1:

I had to make two changes to get it to work:

  • Compile against 3.0 (API 11)

  • Add <uses-sdk android:targetSdkVersion="11"/> to my manifest.



回答2:

You have to put following in your application manifest (AndroidManifest.xml):

<supports screens ... android:xlargeScreens="true">

see: http://developer.android.com/sdk/android-2.3.html ("Extra Large Screens" section)



回答3:

I realize this is old, and you may have found the answer already. Nevertheless, I made a tool to that can scale your layouts to tablets and small screen devices alike:

http://onemanmobile.blogspot.com/2012/04/how-to-scale-your-android-layouts-to.html