在整个屏幕高度内使抽屉布局完整 [英] Make drawerlayout inside fragment full screen height

查看:170
本文介绍了在整个屏幕高度内使抽屉布局完整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个活动A,它由片段B,c等组成.在每个片段中,我都有一个带有片段的抽屉布局.活动A有一个工具栏.问题在于,由于抽屉布局位于片段内部,因此它被绘制在工具栏下方,并且看起来很小.我在抽屉布局片段中使用的数据在片段B,c中可用.那么,有什么方法可以使抽屉布局全高同时将其保留在片段B,c中吗?我用来添加片段的代码是基本代码,因此在此不进行共享.

I have an activity A which consists of fragments B,c etc. In each of the fragments I have a drawerlayout which has a fragment. The activity A has a toolbar. The problem is that since drawerlayout is inside the fragment, it's drawn below the toolbar and looks very small in height. The data I am consuming in my drawerlayout fragment is available in fragments B,c. So is there any way to make drawerlayout full height while keeping it inside fragment B,c? The code I am using to add fragments is basic so I am not sharing it here.

推荐答案

那么有什么办法可以使抽屉布局全高同时保持在片段B,c内?

So is there any way to make drawerlayout full height while keeping it inside fragment B,c?

不.您的片段所占用的空间(宽度/高度)与其添加的内容视图一样多,但不能大于该 View .

No. Your fragment will take as much space (width/height) as the content view it has been added on, it cannot be bigger than that View.

这篇关于在整个屏幕高度内使抽屉布局完整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆