【问题标题】:support 540x960 resolution in my android application在我的 android 应用程序中支持 540x960 分辨率
【发布时间】:2014-09-17 17:27:53
【问题描述】:

我想在我的 android 应用程序中支持 540x960 的屏幕分辨率。 我如何支持这个屏幕?任何建议将不胜感激。

【问题讨论】:

  • -1 不太确定您的问题是什么 - 您无法在此分辨率下进行布局,您需要知道如何检测该特定分辨率?
  • res/layout-w540dp-h960dp/任何你需要的布局放在这个文件夹里
  • 这是有效的解决方案:stackoverflow.com/a/10931395

标签: android android-layout android-screen android-screen-support


【解决方案1】:

您不会在 Android 上开发到特定的分辨率。您编写的布局会自动缩放到不同的大小和纵横比。使用诸如RelativeLayout 之类的类来定义元素应如何相对于彼此放置,并允许它们适应可用空间。您还可以使用 Fragments 针对不同的方向和物理尺寸进行设计(例如平板电脑与手机)。

看看这个文档: http://developer.android.com/guide/practices/screens_support.html

【讨论】:

    【解决方案2】:

    放入AndroidManifest.xml

    <supports-screens android:anyDensity="true"></supports-screens>
    

    或者看看下面的链接。

    Android Multiscreen Support in android : 540x960 issue

    How to support all the different resolutions of android products

    【讨论】:

      【解决方案3】:

      res/layout-long-port-hdpi-960x540/layout.xml

      身高优先

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-12-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多