问题标签 [android-constraintlayout]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 约束布局 - 以编程方式设置方向的指南
是否可以从新的 ConstraintLayout 以编程方式设置 Guideline 的方向?
我正在使用这个版本的 ConstraintLayout 库:
如果你反编译 ConstraintLayout 类,你可以看到 LayoutParams 有字段“orientation”,但它不是一个公共字段,也没有 setter 方法。
android - 是否可以在没有 Android Studio 2.2 预览的情况下使用约束布局?
是否可以在没有 Android Studio 2.2 预览版的情况下使用约束布局,或者我必须安装预览版才能对其进行测试?
android - 如何在 Android 中以编程方式更改作为 ConstraintLayout 子视图的约束?
如何在 Android 中以编程方式更改作为 ConstraintLayout 子视图的约束?我找不到任何有用的文档。我什至找不到源代码或 API 文档。
android - ConstraintLayout with DataBinding incorrect width in RecyclerView
I am trying to play around with new ConstraintLayout. And I made the layout for my RecyclerView's row. It has ConstraintLayout as root element which width is set to match_parent
and when I run my app it renders just as expected
It works well until I put data binding section in my XML and the root element henceforth is layout
tag which wraps ConstraintLayout and it results in some unpredictable change in behavior of ConstraintLayout - it's width henceforth doesn't renders as match_parent
, it only takes small part of display width, though it's still set to match_parent
in XML. I also tried to set width to some fixed value and the result was the same
I suspect that Data Binding processor kinda strips attributes from ConstrainLayout when process layouts during the build process. Is there any way to get things work correctly? My layout
And adapter:
android - CircleCI 找不到 com.android.support.constraint:constraint-layout:1.0.0-alpha3
我已经尝试了很长时间让 ConstraintLayout 与 CircleCI 一起工作。以前它显示我尚未接受 SDK 许可证,因此我将 Android SDK 许可证导出到 CircleCI。(线程是在这里创建的)现在我面临另一个错误,它说:
我很困惑,所以我通过在依赖项中运行以下命令打印出m2repository中的所有文件:pre:
它在那里向我显示约束文件夹:
有没有人遇到过这个问题?请帮忙。
有关更多信息,这是我的 .yml 文件:
android - 任何大小时在约束布局中显示错误的 TextView
我不知道这是否是一个错误,但如果你尝试这种布局:
文本显示不正确。我认为预期的行为会是这样的:
有没有办法在不为父级设置填充的情况下实现与相对布局相同的结果?我在用着com.android.support.constraint:constraint-layout:1.0.0-alpha4
java - 使用 ConstraintsLayouts 设计不同的屏幕尺寸
我已经开始深入研究今年在 IO 上宣布的约束布局。这看起来很有前途,并使您的布局非常有效。我看过 Google 提供的 codelab excersize。但是,我有以下问题想要解决。
- 如何使用ConstraintLayouts来设计不同屏幕尺寸的布局?
目前我为特定的设备/屏幕组设计布局并设置视图的边距和填充等。将这些值保存在dimens.xml
文件中。这是设计布局的一种非常痛苦的方法。Android ConstraintsLayout在设计多屏时是否也模仿了iOS 的AutoConstraintsLayout ?
- 为不同的屏幕方向设计布局是否仍然需要不同的 Layout.xml 文件,即;layout_landscape.xml和layout_portraint.xml?