开发者

How to support extra large screens in Android?

开发者 https://www.devze.com 2023-02-03 17:35 出处:网络
According to this doc page, Android 2.3 supports extra large screen sizes (xlarge), and you can declare that your apps supports this size by adding android:xlargeScreens=\"true\" in开发者_如何学运维 t

According to this doc page, Android 2.3 supports extra large screen sizes (xlarge), and you can declare that your apps supports this size by adding android:xlargeScreens="true" in开发者_如何学运维 the <supports-screens> tag in the Manifest file.

But, since my app is targeted for a minimum SDK version of Android 2.1, compilation fails complaining about unknown attribute.

I don't want to use the new SDK because I won't get warnings if I accidentally use 2.3 specific features.

Is there a way out?


You'll have to use the 2.3 SDK because that attribute simply is not known in lower SDKs. However, what you can do is set your target SDK to be 2.1.


It looks like that element is only supported for Android 2.3. As per the docs here:

Note: Android 2.3 (API Level 9) introduced a new attribute for the element: xlargeScreens

I believe that means that you can't, in fact, use that attribute unless you're compiling for Android 2.3.


This worked for me like a charm.

<supports-screens
    android:largestWidthLimitDp="320"
    android:smallScreens="true"
    android:normalScreens="true"
    android:largeScreens="true"        
    android:xlargeScreens="true"/>

Refer here for more assistance.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号