Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这代码是几个意思呢?加上干嘛的? #2

Open
395808 opened this issue Nov 22, 2016 · 3 comments
Open

这代码是几个意思呢?加上干嘛的? #2

395808 opened this issue Nov 22, 2016 · 3 comments

Comments

@395808
Copy link

395808 commented Nov 22, 2016

mActionBar = getSupportActionBar();
mActionBar.setDisplayOptions(mActionBar.getDisplayOptions() | ActionBar.DISPLAY_HOME_AS_UP);

@minetsh
Copy link
Owner

minetsh commented Nov 22, 2016

DisplayOptions是ActionBar显示的各种控制,DISPLAY_HOME_AS_UP是做上角图标显示,就是返回箭头。

@minetsh minetsh closed this as completed Nov 22, 2016
@395808
Copy link
Author

395808 commented Nov 24, 2016

这不是自定义的ToolBar吗 还要显示原有的角图么

@minetsh
Copy link
Owner

minetsh commented Nov 24, 2016

这个是继承自Toolbar的控件,使用的时候要通过setSupportActionBar()去设置到Activity中,然后才能通过onCreateOptionMenuonOptionMenuSelected等使用用,就把它当做Toolbar使用,只是标题居中了。

@minetsh minetsh reopened this Nov 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants