首页 > 解决方案 > 使用 layout_gravity="bottom||end" xml 时 Android 资源链接失败

问题描述

我试着把我FAB的放在Bottom屏幕的右侧。但是每次我build,如果我使用app它总是失败AAPT errorandroid:layout_gravity="bottom||end"

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

AAPT:错误:'bottom||end' 与属性 layout_gravity (attr) 标志不兼容 [bottom=80,center=17,center_horizo​​ntal=1,center_vertical=16,clip_horizo​​ntal=8,clip_vertical=128,end=8388613,fill= 119,fill_horizo​​ntal=7,fill_vertical=112,left=3,right=5,start=8388611,top=48]。

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

有人可以帮我弄这个吗?

标签: androidxmlandroid-studiofloating-action-buttonandroidx

解决方案


利用

android:layout_gravity="bottom|end"

代替

android:layout_gravity="bottom||end"

推荐阅读