我现在正在使用最新版本的AppCompat和设计支持库。
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
现在我遇到了一些废弃问题
private void setupTabLayout() {
mTabLayout = (TabLayout)findViewById(R.id.tab_layout);
mAdapter = new MyPagerAdapter(getSupportFragmentManager());
mPager = (ViewPager)findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
mTabLayout.setTabsFromPagerAdapter(mAdapter); <!-- deprecated -->
mTabLayout.setupWithViewPager(mPager);
}
有人知道我需要使用什么替代品吗?帮帮我。谢谢。
setupWithViewPager
方法就足够了,不需要同时使用两个方法。 - Nikola Despotoski