This view is not constrained. It only has designtime positions, so it will jump to (0,0) at runtime

使用 ConstraintLayout 遇到的问题

This view is not constrained. It only has designtime positions, so it will jump to (0,0) at runtime

ConstraintLayout是Android Studio 2.2中主要的新增功能之一,我们在使用时遇到了如上所述的问题,通过Design面板拖拽的组件报错。
如图所示,使用ImageView报错

解决方案:
在AndroidStudio升级到3.0 及以上版本时,按如下方法解决。
打开Design面板,在工具栏找到“Infer Constraints”按钮,点击即可。
上图标红所示

猜你喜欢

转载自blog.csdn.net/baidu_30891377/article/details/79863127