【问题标题】:Android: if I create xmls within the folders layout-sw.. is it worthwhile to maintain the same xmls in the default layout folder?Android:如果我在文件夹 layout-sw 中创建 xmls .. 在默认布局文件夹中维护相同的 xmls 是否值得?
【发布时间】:2015-11-04 11:53:46
【问题描述】:

如果我为多个屏幕宽度创建 xmls 并使用文件夹结构 layout-sw[some dp],是否有必要在默认布局文件夹中维护这些文件的副本?是否存在 xml 文件名存在于 sw 文件夹中,但在用户启动活动时会读取常规布局文件夹中具有相同文件名的 xml 的情况?

【问题讨论】:

    标签: java android android-layout android-studio android-xml


    【解决方案1】:

    这是推荐的做法。

    Android 会从限制性更强的文件夹到最少的文件夹(默认文件夹)。

    所以它会先找到,越严格。

    这样,您在不同的文件夹中拥有相同的 xml 文件名,Android 将选择最适合当前设备的文件名。

    希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-21
      • 1970-01-01
      • 2022-01-05
      • 1970-01-01
      • 2014-07-13
      • 2020-11-19
      • 1970-01-01
      • 2020-09-06
      相关资源
      最近更新 更多