简体   繁体   中英

Android: override Resource in layout

Sometimes I see a warning like this:

在此处输入图像描述

What happen if I override or not the layout Resource?

If you override the layout resource, a new copy of it is created with configuration qualifiers. In this case, layout-v26 . This version of the resource is used on API level 26 and above while the qualifier-free version in layout is the default.

For issues like this you probably don't want to do that as then you have one more version of the layout to maintain.

Unknown XML attributes are ignored at runtime, so the problem is only that the attribute does nothing on pre-v26 runtimes. If that's fine, then you can just ignore the warning with tools:ignore="UnusedAttribute" .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM