OSDN Git Service

original
[gb-231r1-is01/GB_2.3_IS01.git] / sdk / layoutopt / libs / uix / src / resources / rules / IncorrectHeightInScrollView.rule
diff --git a/sdk/layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule b/sdk/layoutopt/libs/uix/src/resources/rules/IncorrectHeightInScrollView.rule
new file mode 100644 (file)
index 0000000..36d3c2e
--- /dev/null
@@ -0,0 +1,11 @@
+// Rule: IncorrectHeightInScrollView
+//
+// Description: Checks whether a scrollview's child has the wrong dimension.
+//
+// Conditions:
+// - The node has a ScrollView parent
+// - The node has a height set to match_parent
+
+if (node.'..'.is("ScrollView") && node.isHeightFillParent()) {
+    analysis << "This ${node.name()} tag should use android:layout_height=\"wrap_content\""
+}