如何实现像标签一样的游戏存储(滚动隐藏,适当的边距,细指示器)?我已经尝试过SlidingTabs和其他一些库,但它们都已经过时了.
更详细的说,当我开发API 20及更少(在Android 5.0之前)时,我曾经打过电话actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
?现在使用Android 5.0,整个ActionBar正在被ToolBar取代.
使用ToolBar在Material Design中使用Tabs的正确方法是什么?如何在滚动时隐藏标签?
谢谢!
截图:
Searchview没有做任何事情,看起来它没有加载可搜索的信息.它在免费构建中完美运行,但在专业版中不起作用.我已经尝试禁用proguard,尝试调试和发布版本.
主要:
public boolean onCreateOptionsMenu(final Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.action_search_view).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
return true;
}
Run Code Online (Sandbox Code Playgroud)
摇篮:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/repo' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/repo' }
}
android {
signingConfigs {
rollout {
}
}
compileSdkVersion 21 …
Run Code Online (Sandbox Code Playgroud)