android:screenOrientation? Can you use landscapes on high-resolution devices?

Is there a technology that only allows landscape on large equipment?

I can set the active manifest.xml file according to the sensor, such as Android: screenorientation = "sensor", but this does not provide the behavior I want

For example, I want to allow users to enter landscape mode on tablet devices, but not on smaller resolution devices (because the user interface looks terrible)

As far as I know, if the direction is acceptable, it cannot respond dynamically (for example, at runtime). Is there still?

Did I miss anything? Thank you in advance!

resolvent:

You can do this with resource folders:

For smaller landscapes – default:

  /layout/main.xml

Main.xml root layout: orientation = "portrait" (enforce portrait here instead of in listing)

For high resolution allowed portraits:

 /layout-port-hdpi/main.xml 

Main.xml is just the hdpi

This article is available from resourcetypes

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>