导航抽屉的背景图像尺寸(剖面图 - 第一行)

时间:2015-05-08 07:51:24

标签: android navigation-drawer material-design

我正在尝试按照Official Material Design guidelines设置导航抽屉的样式。尽管第一行的背景图像大小 - 配置文件部分,但这里定义了所有内容。我所拥有的是:

enter image description here

但是你可以看到图像看起来很紧张。我的设置如下:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/mat2" >
    <com.blackB.RoundedImageView
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/icon"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_marginLeft="16dp"
        android:background="@drawable/icon_default"
        android:contentDescription="@string/imageviewContactus"
        android:scaleType="centerCrop"
        app:riv_border_color="#BDBDBD"
        app:riv_border_width="0dip"
        app:riv_corner_radius="38dip"
        app:riv_mutate_background="true"
        app:riv_oval="true" />

    <RelativeLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:layout_marginLeft="72dp" 
        android:gravity="left|center">

        <TextView
            android:id="@+id/counter"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignLeft="@+id/title"
            android:layout_below="@+id/title"
            android:text="Profile completion"
            android:textColor="#FFFFFF"
            android:textSize="14sp" />

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Mr.Right"
            android:textColor="#FFFFFF"
            android:textSize="14sp" />
    </RelativeLayout>

</RelativeLayout>

我也尝试使用Imageview作为背景,它仍然延伸。截至目前,我的图像规格为800x600px,与image used by google in iosched相同,并保存在drawable-nodpi中,就像谷歌一样。

我在这里错过了吗?请建议。谢谢:)

1 个答案:

答案 0 :(得分:5)

mdpi-
    width=384 pixels
    height=216 pixels
hdpi-
    width=576 pixels
    height=324 pixels
xhdpi-
    width=768 pixels
    height=432 pixels
xxhdpi-
    width=1152 pixels
    height=648 pixels

图片来源= Google报亭应用,工具= Adob​​e photoshop 7.0

相关问题