使用 Material Design 控件
2017-11-10 本文已影响1人
几千里也
官方文档
Using the Design Support Library
android.support.design.widget
添加依赖
compile 'com.android.support:design:27.0.0'
举个例子
// gradle
compile 'com.android.support:design:26.1.0'
// java
import android.support.design.widget.TabLayout;
viewPager.setAdapter(new FragmentPagerAdapter(getSupportFragmentManager()) {
...
});
tableLayout.setupWithViewPager(viewPager);
// xml
<android.support.design.widget.TabLayout
... />