Android布局编辑器ConstraintLayout

Android布局编辑器ConstraintLayout

本文介绍了Android布局编辑器ConstraintLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Android Studio(前几天进行了最新的Stabel升级.当我使用布局编辑器时,它似乎更喜欢ConstraintLayout.当我移动两个小部件(一个TextView和一个按钮)时,它在编辑器上看起来正常,但是当我在模拟器设备(Nexus 4)中尝试使用它们时,它们都都位于右上角.在我的真实设备上也是如此.这里是否存在版本问题?

I am running Android Studio (put on latest stabel upgrade the other day. When I use the Layout editor it seems to prefer ConstraintLayout. When I move two widgets (one TextView and one button) around it looks all right on the editor, but when I try to it in an emulator device (Nexus 4) they both ends up in the Upper right corner. Same thing on my real device. Is there some version problem here?

推荐答案

请在此处检查ConstraintLayout:

Please check ConstraintLayout here:

https://developer.android.com/training/constraint-layout/index.html

换句话说,这意味着您必须为视图添加至少一个水平约束和一个垂直约束

In other words, it means you must add at least one horizontal and one vertical constraint for the view

这篇关于Android布局编辑器ConstraintLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 04:00