This view is not constrained vertically: at runtime it will jump to the left unless you add a vertic

Android studio 使用约束布局(ConstraintLayout)报错:

This view is not constrained vertically: at runtime it will jump to the left unless you add a vertical constraint less… (Ctrl+F1)
The layout editor allows you to place widgets anywhere on the canvas, and it records the current position with designtime attributes (such as layout_editor_absoluteX.) These attributes are not applied at runtime, so if you push your layout on a device, the widgets may appear in a different location than shown in the editor. To fix this, make sure a widget has both horizontal and vertical constraints by dragging from the edge connections.
This view is not constrained vertically: at runtime it will jump to the left unless you add a vertic_第1张图片

解决方案:
1.切换xml到design试图下
2.选中ConstraintLayout右键选择Constraint Layout中的Infer Constraints
This view is not constrained vertically: at runtime it will jump to the left unless you add a vertic_第2张图片

你可能感兴趣的:(Android)