Last active
June 27, 2016 00:52
-
-
Save yahyaahrika/e624051747b082e5912c38d1b0991aac to your computer and use it in GitHub Desktop.
toolbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout 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.cco.statrt.all_toolbar.MainActivity"> | |
<android.support.v7.widget.Toolbar | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:minHeight="200dp" | |
android:background="#ff0000" | |
android:layout_alignParentBottom="true" | |
android:layout_height="200dp"> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:onClick="test" | |
android:src="@drawable/ic_delete"/> | |
</android.support.v7.widget.Toolbar> | |
</RelativeLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); | |
setSupportActionBar(toolbar); | |
toolbar.setNavigationIcon(R.drawable.ic_account); | |
toolbar.setNavigationContentDescription("face"); | |
toolbar.setLogo(R.drawable.ic_message_plus); | |
toolbar.setLogoDescription("test"); | |
toolbar.setNavigationOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
Toast.makeText(getApplicationContext(), | |
"setNavigationOnClickListener",Toast.LENGTH_SHORT).show(); | |
} | |
}); | |
// ActionBar actionBar1 = getSupportActionBar(); | |
// getSupportActionBar().setTitle("ello whj"); | |
// | |
// getSupportActionBar().setDisplayShowHomeEnabled(true); | |
// getSupportActionBar().setLogo(R.drawable.ic_delete); | |
// getSupportActionBar().setDisplayUseLogoEnabled(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tutorial http://www.101apps.co.za/index.php/articles/using-toolbars-in-your-apps.html