0

I want to align the icons accordingly in my android app in the top bar my top bar has side menu on the left image

It has some empty space after the side menu icon I want to fill that space by arranging the icons accordingly but I don't know how to do that

please help me to avoid that empty space and put the icon in that place

I have also attached image for better view

Thanks

Wilson Christian
  • 650
  • 1
  • 6
  • 17

2 Answers2

0

please try to create a custom layout for action bar & inflate it.

NishaL
  • 33
  • 1
  • 6
0

You can use setlogo method in toolbar to fill the your desired space

toolbar.setLogo(R.drawable.yourlogo);

or simply set all icon inside your toolbar according to your requirement. like this

<android.support.v7.widget.Toolbar
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize">
    <LinearLayout
        android:layout_width="wrap_content"
        android:orientation="horizontal"
        android:layout_height="wrap_content">
        <ImageView
            android:layout_width="wrap_content"
            android:background="@mipmap/ic_launcher"
            android:layout_height="wrap_content" />
        <ImageView
            android:layout_width="wrap_content"
            android:background="@mipmap/ic_launcher"
            android:layout_height="wrap_content" />
        <ImageView
            android:layout_width="wrap_content"
            android:background="@mipmap/ic_launcher"
            android:layout_height="wrap_content" />
        <ImageView
            android:layout_width="wrap_content"
            android:background="@mipmap/ic_launcher"
            android:layout_height="wrap_content" />
        <ImageView
            android:layout_width="wrap_content"
            android:background="@mipmap/ic_launcher"
            android:layout_height="wrap_content" />
    </LinearLayout>

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

Hope this help!

Akp
  • 259
  • 1
  • 9