android 包含布局,Android中的包含布局已拉长

获得示例代码,当它自己运行时工作正常。但是,当我将它添加到我自己的项目时,包括'include'的行:

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@color/chat_background_color"

android:focusableInTouchMode="true"

android:orientation="vertical">

android:id="@+id/messages_listview"

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="1"

android:transcriptMode="alwaysScroll"

android:divider="@null"

android:dividerHeight="0dp" />

android:id="@+id/emojicons_fragment"

class="emoji.EmojiFragment"

android:layout_width="match_parent"

android:layout_height="250dp"

tools:layout="@layout/fragment_emoji" />

延伸整个LinearLayout(屏幕)。在布局文件本身,一切看起来都很好,并且在RelativeLayout中与父级的顶部对齐。

为什么所有'包含'在我的项目中失败了,但是当我在原始项目中运行完全相同的布局时,它工作正常?

使用Android Studio。

他们自己的观点位于RelativeLayout,高度限制为50dp。

当我将50dp高度定义添加到包含它似乎很好,但我想知道这是如何工作来更好地理解问题的原因。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值