Skip to content

Instantly share code, notes, and snippets.

@gvr23
Created January 13, 2018 02:01
Show Gist options
  • Save gvr23/3a9e4ada1ede2ab903d875100fbf6b94 to your computer and use it in GitHub Desktop.
Save gvr23/3a9e4ada1ede2ab903d875100fbf6b94 to your computer and use it in GitHub Desktop.
manera para setear un toolbar
ANDROID
===================================================================================================================================
setSupportActionBar(tbDocumento);
ActionBar actBar = getSupportActionBar();
if (actBar != null) {
actBar.setDisplayHomeAsUpEnabled(true);
actBar.setIcon(R.drawable.ic_shopping_cart);
actBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back);
actBar.setTitle("Editar Documento");
actBar.setDisplayShowTitleEnabled(true);
}
==================================================================================================================================
xml
==================================================================================================================================
<android.support.v7.widget.Toolbar
android:id="@+id/tbDocumento"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_primary"
app:titleMarginStart="@dimen/margin_large"
style="@style/TitleStyle"
app:titleTextColor="@color/color_white"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment