What is MergeRootFrame in FrameLayout?
Asked Answered
K

2

13

In FrameLayout of XML we have an attribute by name tools:ignore="MergeRootFrame", what is MergeRootFrame ?

Kagoshima answered 12/11, 2014 at 5:46 Comment(0)
O
21

It's for the Lint tool. You're asking it to ignore (i.e. not show warnings for) the "MergeRootFrame" rule:

"MergeRootFrame": Checks whether a root <FrameLayout> can be replaced with a <merge> tag

Orlan answered 12/11, 2014 at 5:48 Comment(0)
A
4

<tools> attributes is basically used as a shortcut to store information and facilitating Android platform with required conditions without further computation. "tools:ignore" is a statement which actually is telling Lint tool to ignore "issue id" - "MergeRootFrame".

based on ipavl's answer - <merge> tag is is basically used to remove multiple layers of viewgroups which are not required / degrades UI performance. this statement basically asks Lint to ignore warnings where, there are multiple redundant <framelayout>'s and this could be further optimized my replacing it with <merge>

This is explained here, beautifully - Warning: This <FrameLayout> can be replaced with a <merge> tag

Bottom line: Technically you are asking Lint to ignore warnings of this kind

Links:

http://tools.android.com/tech-docs/tools-attributes , https://developer.android.com/training/improving-layouts/reusing-layouts.html

Anastaciaanastas answered 31/8, 2016 at 7:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.