【问题标题】:How to show complete image in Navigation drawer background如何在导航抽屉背景中显示完整的图像
【发布时间】:2016-09-13 22:04:45
【问题描述】:

我在Navigation Drawer 背景中放了一张图片。图像在那里,但它不适合视图中的完整图像,图像的上部围绕5% 部分图像没有出现在视图中,这就是主要部分,我想要它在背景中。

这是我的代码。

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.myapp.HomeActivity"
    android:id="@+id/drawer_layout_main"
    >
    <android.support.design.widget.NavigationView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:id="@+id/navigation_view"
        android:layout_gravity="start"
        android:background="@drawable/sidebg"
        android:gravity="bottom|left"
        android:dividerHeight="0dp"
        app:itemIconTint="@android:color/white"
        android:scaleType="fitStart"
        >

        <include layout="@layout/navigation_items"/>

    </android.support.design.widget.NavigationView>


</android.support.v4.widget.DrawerLayout>

请指导我如何在导航抽屉背景中显示完整的图像。

【问题讨论】:

  • 您是否尝试将android:fitsSystemWindows="true" 添加到&lt;android.support.design.widget.NavigationView&gt;
  • 只是累了,但没有成功
  • 你修好了吗?
  • @RaguSwaminathan 还没有
  • 你能分享一下它的截图吗?

标签: android android-layout android-fragments android-activity navigation-drawer


【解决方案1】:

这不是一个合适的答案,但你可以做的是减小文件大小然后应用

【讨论】:

  • 没有代码,你可以在一些编辑器中改变图像的大小然后应用。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-09-21
  • 2019-09-07
  • 2015-07-19
  • 1970-01-01
  • 1970-01-01
  • 2016-10-16
相关资源
最近更新 更多