How to make application scale to large (tablet) screen in Android SDK

帅比萌擦擦* 提交于 2019-12-12 09:26:30

问题


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



来源:https://stackoverflow.com/questions/6132912/how-to-make-application-scale-to-large-tablet-screen-in-android-sdk

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