平板电脑上的ic_drawer.png可点击大小

时间:2015-06-02 09:31:08

标签: android android-studio icons navigation-drawer

我调整了工具栏的高度,但ic_drawer.png可点击区域不占用工具栏的所有高度,垂直居中或者放置更高的图标大小,那么该如何操作呢?

<android.support.v7.widget.Toolbar
    xmlns:local="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_toolbar"
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:background="#263355"
    local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    local:popupTheme="@style/ThemeOverlay.AppCompat.Light"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <LinearLayout
        android:id="@+id/main_toolbar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="vertical">

        <TextView
            android:id="@+id/main_toolbar_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#ffffff"
            android:textSize="16sp"
            android:textIsSelectable="false"
            android:textAlignment="center"
            android:layout_marginRight="24dp" />

    </LinearLayout>

</android.support.v7.widget.Toolbar>

看上面是左上角: enter image description here

1 个答案:

答案 0 :(得分:0)

默认drawable仅以其大小呈现。以您的方式调整工具栏大小时,将调整父布局的大小;它的儿童用品可能不是。该图标是ImageButton的子项目(可能是ToolBar)。您可能必须尝试一些自定义实现/覆盖。

相关问题