gpt4 book ai didi

android - 如何以编程方式确定应用程序要使用的原始布局文件夹

转载 作者:行者123 更新时间:2023-11-29 17:56:23 26 4
gpt4 key购买 nike

我们如何确定应用程序最初搜索的布局文件夹?

例如。

应用程序搜索 layout-sw600dp 但使用 layout-xhdpi,因为 sw600dp 不存在。

最佳答案

Providing Resources 中概述了选择要使用的适当资源的过程。 Android 开发者指南中的文档。

  1. Eliminate resource files that contradict the device configuration.
  2. Pick the (next) highest-precedence qualifier in the list
  3. Do any of the resource directories include this qualifier?
    • If No, return to step 2 and look at the next qualifier.
    • If Yes, continue to step 4.
  4. Eliminate resource directories that do not include this qualifier.
  5. Go back and repeat steps 2, 3, and 4 until only one directory remains.

简而言之,Android 应用程序不会“寻找”特定的资源文件;相反,他们会为给定设备选择最匹配的资源文件。

限定符优先级表can be found here .

关于android - 如何以编程方式确定应用程序要使用的原始布局文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19055331/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com