Layout for FHD (1080x1920) on Android

Asked 1 months ago, Updated 1 months ago, 6 views

How can I create a layout for FHD (1080x1920) on Android?
The problem is that I want to separate the layout of FHD+ or Quad HD+ from FHD, but it looks like this:

Here's what I've tried:
1.Create layout for FHD by creating layout-w1080dp-h1920dp/hoge.xml
→layout/hoge.xml loaded

2.Create definition for FHD by creating values-w1080dp-h1920dp/dimens.xml
→ values-sw360dp/dimens.xml loaded

The development environment is as follows.
Tools: Android Studio

layout files:
/res/layout/hoge.xml

dimens file /res/values/dimens.xml
/res/values-sw360dp/dimens.xml
/res/values-sw600dp/dimens.xml
/res/values-sw720dp/dimens.xml

Thank you for your cooperation.

android android-studio android-layout

2022-09-30 14:16

1 Answers

It's self-solving.

I got the screen size from the program and avoided it by setting a different layout in setContentView for FHD.


2022-09-30 14:16

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.