关于Android Studio3.5.2安卓应用布局Missing Constraints in ConstraintLayout错误解决方法

错误详细提示:This view is not constrained. It only has designtime positions, so it will jump to (0,0) at runtime unless you add the constraints 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. Issue id: MissingConstraints

此视图不受约束。它只有设计时位置,因此它将在运行时跳转到(0,0),除非您添加约束,否则布局编辑器允许您将小部件放置在画布上的任何位置,并且它使用设计时属性(如布局编辑器绝对值)记录当前位置。这些属性在运行时不应用,因此如果在设备上推送布局,则小部件可能会显示在与编辑器中显示的位置不同的位置。要解决此问题,请通过从边缘连接拖动来确保小部件同时具有水平和垂直约束。问题id:缺少约束

出现这种错误的时候 ,我们的处理方式是,做一遍:拖拽界面中按钮四周的圆点,到你想要设置的相对距离
在这里插入图片描述


出现这种错误的时候 ,我们的处理方式是,做一遍:将控件从设计器的边缘拖动到你想要的位置,而不是直接从控件窗口拖到窗口就算了。这样constraint属性下就不会出现错误的了。

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/poolooloo/article/details/105805836