杂七杂八的功能实现

来源:互联网 发布:淘宝网中年雪纺衫 编辑:程序博客网 时间:2024/06/11 00:16

设置ToolBar,隐藏ActionBar

Toolbar toolbar = (Toolbar) findViewById(R.id.toobar);        setSupportActionBar(toolbar);

去除Toolbar自有的Title,在布局中使用app:title=""是不会起作用的,还是会显示ActionBar的标题

getSupportActionBar().setDisplayShowTitleEnabled(false);

toolbar按钮的跳转

public boolean onOptionsItemSelected(MenuItem item) {        switch (item.getItemId()) {            case android.R.id.home:                finish();                break;        }        return super.onOptionsItemSelected(item);}







原创粉丝点击