本文整理了Java中android.support.v7.widget.Toolbar.getWidth()
方法的一些代码示例,展示了Toolbar.getWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.getWidth()
方法的具体详情如下:
包路径:android.support.v7.widget.Toolbar
类名称:Toolbar
方法名:getWidth
暂无
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
@Override
public void run() {
statusBarOverlay.setBounds(new Rect(0, 0,
toolbar.getWidth(), toolbar.getPaddingTop()));
toolbar.getOverlay().add(statusBarOverlay);
}
});
代码示例来源:origin: XunMengWinter/Now
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
setTitle("");
toolbar = mMaterialViewPager.getToolbar();
if (toolbar != null) {
setSupportActionBar(toolbar);
final ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayShowHomeEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setHomeButtonEnabled(true);
}
toolbar.setLayoutParams(new RelativeLayout.LayoutParams(toolbar.getWidth(), UIHelper.getStatusBarHeight()));
}
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, 0, 0);
mDrawerLayout.addDrawerListener(mDrawerToggle);
checkIsFirst();
initDrawer();
}
代码示例来源:origin: erikcaffrey/Android-Spotify-MVP
private void setupSearchView(Menu menu) {
SearchManager searchManager =
(SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
searchView.setQueryHint(getString(R.string.search_hint));
searchView.setMaxWidth(toolbar.getWidth());
searchView.setOnQueryTextListener(this);
}
内容来源于网络,如有侵权,请联系作者删除!