Comment mettre Android barre d'outils de la hauteur?

Je veux réaliser ce:

Comment mettre Android barre d'outils de la hauteur?

Ce que je pensais à faire une Barre d'outils Personnalisée avec une plus grande hauteur et de travailler avec les tabhost et tabpager normalement. J'ai mis en œuvre, mais la barre d'outils est de montrer la hauteur normale, de sorte qu'il n'affiche pas comme je veux, juste la partie supérieure. Est-ce la bonne solution ou est-il possible de définir un TabHost ci-dessous un Linéaire de/par rapport de Mise en page? Parce que je n'ai pas besoin de travailler avec elle comme une barre d'action.

Code

toolbar.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbarTitle"
    android:orientation="vertical"
    android:background="@color/black"
    android:layout_width="match_parent"
    android:fitsSystemWindows="true"
    android:minHeight="?attr/actionBarSize"
    android:theme="@style/AppTheme"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/img_logo"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="55dp"
        android:scaleType="centerInside"
        android:src="@drawable/logo_home"
        />

    <TextView
        android:id="@+id/txt_version"
        android:text="@string/app_version"
        android:textColor="@color/white"
        android:layout_below="@+id/img_logo"
        android:paddingBottom="10dp"
        android:paddingTop="15dp"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
    </RelativeLayout>
</android.support.v7.widget.Toolbar>

Et cette fonction dans l'Activité:

private void setupActionBar()
    {
        ActionBar ab = getSupportActionBar();
        ab.setDisplayShowCustomEnabled(true);
        ab.setDisplayShowTitleEnabled(false);
        LayoutInflater inflator = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View v = inflator.inflate(R.layout.toolbar_title, null);
        ab.setCustomView(v);
    }
Vous êtes à l'aide de la ActionBar. Où est votre Toolbar code? Vous pouvez définir la hauteur ici android:minHeight="?attr/actionBarSize" dans votre XML. L'utilisation de la hauteur et de ne pas minHeight.

OriginalL'auteur Alejandro Cumpa | 2015-06-26