android-ConstraintLayout屏障在设计视图中不可见

android-ConstraintLayout屏障在设计视图中不可见,第1张

概述我正在尝试在AndroidStudio中为我的ConstraintLayout添加障碍,但它并未显示设计视图中应有的方式.我一直在关注thistutorial,但无法正常工作.我目前正在使用:>AndroidStudio3.1.1>androidx.constraintlayout:constraintlayout:1.1.3我尝试过的事情:>使缓存无效/重启>删除属

我正在尝试在Android Studio中为我的ConstraintLayout添加障碍,但它并未显示设计视图中应有的方式.

我一直在关注this tutorial,但无法正常工作.

我目前正在使用:

> AndroID Studio 3.1.1
> androIDx.constraintlayout:constraintlayout:1.1.3

我尝试过的事情:

>使缓存无效/重启
>删除属性工具:layout_editor_absoluteX
>摆弄!

这是我的test.xml:

<?xml version="1.0" enCoding="utf-8"?><androIDx.constraintlayout.Widget.ConstraintLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"                                                   xmlns:app="http://schemas.androID.com/apk/res-auto"                                                   xmlns:tools="http://schemas.androID.com/tools"                                                   androID:layout_wIDth="match_parent"                                                   androID:layout_height="match_parent">    <button            androID:text="button"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:ID="@+ID/button" androID:layout_margintop="8dp"            app:layout_constrainttop_totopOf="parent" app:layout_constraintStart_toStartOf="parent"            androID:layout_marginStart="8dp"/>    <button            androID:text="button"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:ID="@+ID/button2" androID:layout_margintop="8dp"            app:layout_constrainttop_toBottomOf="@+ID/button" app:layout_constraintStart_toStartOf="parent"            androID:layout_marginStart="8dp"/>    <androIDx.constraintlayout.Widget.barrIEr androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content"                                              androID:ID="@+ID/barrIEr2" app:barrIErDirection="end"                                              app:constraint_referenced_IDs="button,button2"                                              tools:layout_editor_absoluteX="411dp"/></androIDx.constraintlayout.Widget.ConstraintLayout>

在设计视图中,它看起来像是this

障碍固定在布局的边缘,无论我做什么都不会移动.如果我设置barrIErDirection开始或离开它根本不可见.如果我将端点或右边设置为虚线,则虚线会出现,但会停留在布局的左侧.

另一个项目中的障碍seem to work fine从头开始,但这使用的是androID.support.constraint.ConstraintLayout而不是androIDx库的.

解决方法:

升级到2.0.0-Alpha3版本对我来说解决了这个问题.

总结

以上是内存溢出为你收集整理的android-ConstraintLayout屏障在设计视图中不可见全部内容,希望文章能够帮你解决android-ConstraintLayout屏障在设计视图中不可见所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1081820.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存