您的位置:首页 > 大数据 > 人工智能

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

2017-06-08 16:24 1306 查看
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.



解决方案:

1.切换xml到design试图下

2.选中ConstraintLayout右键选择Constraint Layout中的Infer Constraints

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android
相关文章推荐