Стрелка не подгоняется под toolbar. Иконка подгоняется но только сверху и с низу как видно по сторонам зазор большой. Собственно как внутренние элементы сделать match_parant
?
toolbar.xml
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_actionbar"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:background="@color/colorPrimary">
<!--android:visibility="gone"-->
<ImageView
android:id="@+id/imageView"
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@color/status_bar_orange"
/>
</android.support.v7.widget.Toolbar>
activity_layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.gcm.bogdan.toolbar.MainActivity"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- **** Place Your Content Here **** -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"/>
<!-- **** Place Your Content Here **** -->
<View android:layout_width="match_parent"
android:layout_height="5dp"
android:background="@drawable/toolbar_dropshadow"/>
</FrameLayout>
</LinearLayout>
Activity
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
public class MainActivity extends AppCompatActivity {
Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mToolbar = (Toolbar)findViewById(R.id.toolbar);
mToolbar.setLogo(R.drawable.ic_logo);
mToolbar.setLogoDescription(getResources().getString(R.string.app_name));
mToolbar.setSubtitle("SubTittle");
mToolbar.setSubtitleTextColor(getResources().getColor(R.color.colorLogo));
mToolbar.setTitle("Tittle");
mToolbar.setTitleTextColor(getResources().getColor(R.color.colorAccent));
mToolbar.setNavigationIcon(R.drawable.ic_back);
mToolbar.setNavigationContentDescription("NavigationContentDescription");
}
}