Android 平板电脑应用程序兼容性
我的 Android 应用程序安装在平板电脑上时占用的空间与手机上占用的空间相同,这是什么原因?我需要做什么才能让它伸展以占据平板电脑屏幕的整个区域?
What,s the reason that my Android app when installed on a tablet occupies the same space that it does on a phone. What do I have to do to hav it stretched out to occupy the full area of the tablet screen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这个问题很好理解并且很容易修复 - 它只发生在为兼容 API 级别 3 或更低级别而设置的应用程序中。因此,最简单的解决方案是进入清单并更改最小 API(除非这对您来说是一个问题)
Android 将您的问题记录为“基本上,系统在一个小窗口中显示应用程序,该窗口大约是正常屏幕的大小”
android 文档建议了一些其他解决方案
This problem is well understood and easy to fix - it only occurs in applications set for compatibility to API level 3 or below. So the easiest solution is to go into the manifest and change the minimum API (unless this is an issue to you)
Android documents your problem as 'basically, the system displays the application in a small window that is roughly the size of the normal screen size'
The android docs suggest some other solutions
要使您的应用程序在不同尺寸的屏幕上运行(例如使用 dp 表示尺寸等),您需要考虑一些事情。这是 android 支持多屏幕教程。
There are couple of things you need to consider to make your app work across different size of screens (For example using dp for size etc.,). Here is android supporting multiple screens tutorial.
这也是我一直遇到的问题。这确实让我有点恼火,但这是可以预料的。请参阅此处:Android 文档:支持多种屏幕尺寸。
发生的情况如下硬件变得更好,屏幕尺寸(和有效 dpi)增加。这使得新硬件的屏幕能够支持更多的屏幕内容,从而使你放置在其上的所有内容都显得更小。
为了解决这个问题,您需要提供更大的图像来扩展内容。这就是 九个补丁 的用武之地。它对于制作巨大的内容非常有用一张简单(小)基础图像的不同尺寸的东西。 Android 在此处提供了有关九个补丁的精彩教程。
除了正常的九个补丁之外,我还建议针对不同的屏幕尺寸使用不同的布局。这就是我的烦恼,但这确实是必要的。请参阅此处获取相关帮助。
This is a problem I have been having too. It really kinda irks me, but it's to be expected. Refer here: Android Docs: Supporting multiple screen sizes.
What's going on, is as hardware gets better, the screen sizes (and effective dpi) increases. This makes the screen of the new hardware be able to support more content on the screen, thus making everything you place on it appear smaller.
To get around this, you will need to provide larger images to stretch out the content. This is where nine patch comes in. It is extremely useful for making hugely different sizes of stuff for one simple (and small) base image. Android has a fantastic tutorial on nine patch here.
In addition to the normal nine patch, I recommend different layouts for different screen sizes. This is what eats me, but it really is a necessity. Look here for some help on that.
一开始这可能看起来无关紧要,但最近我在 Hudl 2 平板电脑的 Google Play 商店中出现我的 Android 应用程序时遇到了麻烦。
事实证明,我需要在清单中添加几行,以提高应用程序与更多设备的兼容性。
有关“uses-feature”的更多信息
This might appear unrelated at first but I recently had an awful time getting my android app appearing in the Google Play store for a Hudl 2 tablet.
It turned out I needed to add a couple of lines in my manifest in order to increase my apps compatibility with more devices.
More about "uses-feature"