使用 layout_gravity ="bottom||end"xml 时 Android 资源链接失败

标签 android xml android-studio floating-action-button androidx

我试着把我的 FABBottom 上屏幕右侧。但每次我build app , 它总是失败 AAPT error如果我使用 android:layout_gravity="bottom||end"

这是详细的错误: Android 资源链接失败

AAPT: error: 'bottom||end' is incompatible with attribute layout_gravity (attr) flags [bottom=80, center=17, center_horizontal=1, center_vertical=16, clip_horizontal=8, clip_vertical=128, end=8388613, fill=119, fill_horizontal=7, fill_vertical=112, left=3, right=5, start=8388611, top=48].

我试过使用 android:layout_gravity="bottom"它工作得很好。

有人可以帮我吗?

最佳答案

使用

android:layout_gravity="bottom|end"

代替

android:layout_gravity="bottom||end"

关于使用 layout_gravity ="bottom||end"xml 时 Android 资源链接失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58038941/

相关文章:

android - 如何向android studio 添加外部依赖项(jar 文件)?

android-studio - 为什么我的行号在Android Studio中不断消失?

android - Android 的 Cordova 错误 : JDK/Android Target

java - Android 手势、单笔划和多笔划产生不一致的结果

android - 我如何查看我的应用程序在其 VM 预算中使用了多少内存?

python - 如何扩展XSD方案以支持SVG?

xml - Plone - XSLT/Diazo - 替换 Plone Portal-personaltools 标记

android - 无法解析设计 :27. 1.1 的依赖性

android - 用Kotlin执行房间时出现错误

java - 合并两个服务?