为什么我的DrawerLayout 的侧滑层的Header不能扩展至状态栏下?

billowlau 2015-06-23 12:07:29
DrawerLayout

rt,为什么我的DrawerLayout 的侧滑层(Drawer)的Header不能扩展至状态栏下?
我的Drawer层可以扩展至状态栏了,但是是添加的Header就不行,如图所示。

相关Theme设置:
<!-- Application theme. -->
<style name="AppTheme" parent="AppTheme.Base">

<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<!-- Status bar color -->
<item name="android:statusBarColor">@color/base_color_half</item>

<item name="android:windowTranslucentNavigation">true</item>
<!-- Navigation bar color -->
<item name="android:navigationBarColor">@color/base_color_half</item>
</style>


Drawer View定义:
<!-- Sid Drawer -->

<LinearLayout
android:id="@+id/drawer_view"
android:layout_width="270dp"
android:layout_height="match_parent"
android:layout_gravity="start|top"
android:background="@android:color/white"
android:clickable="true"
android:fitsSystemWindows="true"
android:orientation="vertical">

<!--Header 层-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/drawer_header">

<TextView
style="@style/DefaultTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:padding="@dimen/padding_base"
android:text="@string/app_name" />
</LinearLayout>
</LinearLayout>
...全文
193 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
那一刻-逐风 2017-02-09
  • 打赏
  • 举报
回复
http://blog.csdn.net/qq_34199415/article/details/52650086?locationNum=3 这个可以解决
billowlau 2015-06-23
  • 打赏
  • 举报
回复
顶起来。。。求大师显身

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧