Android S3 layout vs Galaxy Nexus layout

后端 未结 4 944
-上瘾入骨i
-上瘾入骨i 2020-12-10 07:43

I\'ve developed an app that was supposed to target both the Galaxy Nexus and the Galaxy S3. Both have 720 x 1280 screen resolutions and I have only used \'dp\' values in my

相关标签:
4条回答
  • 2020-12-10 08:10

    Nexus 4: use sw384dp (768x1280)

    Samsung S3: use sw360dp (720x1280)

    It should be noted that both do fall into the sw360dp bucket, but some developers might need to make things pixel perfect, so the 384 folder might be needed but should be avoided if you can design a more flexible layout using LinearLayout and "weight" instead of hardcoding dp units.

    0 讨论(0)
  • 2020-12-10 08:12

    I use sw360dp-long which the system will use for the GS3 and I use sw360dp for the Galaxy Nexus.

    0 讨论(0)
  • 2020-12-10 08:24

    Use this scheme:

    For same layout landscape and portrait layout-sw360dp

    Only for landscape layout-sw360dp-land

    Only for portrait layout-sw360dp-port

    I try to say you can use the before clasification creating folders with theses names. The layout located into are loaded in the Galaxy S3 - WXGA720. This is a way for disting the layout for this type of device. Its necesary Android 4.0+.

    0 讨论(0)
  • 2020-12-10 08:33

    You can get the device model and can set layout.

    As following you can get model

    String phoneModel = android.os.Build.MODEL;
    if(phoneModel.equals("ABC")) {
        // SET Ralated Layout
    } else if(phoneModel.equals("XYZ")) {
        // SET Ralated Layout
    }
    
    0 讨论(0)
提交回复
热议问题