0
我無法在按下標籤時使用漣漪效應請幫助我已經嘗試了很多,並且一整天都在拼命掙扎。如何在預棒棒糖和棒棒糖設備上使用漣漪效應?標籤的漣漪效應
MainActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mPager=(ViewPager)findViewById(R.id.pager);
mPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(),getApplicationContext()));
mTabs=(SlidingTabLayout)findViewById(R.id.tabs);
mTabs.setDistributeEvenly(true);
mTabs.setCustomTabView(R.layout.customtablayout,R.id.textTab);
mTabs.setBackgroundColor(getResources().getColor(R.color.colorAccent));
mTabs.setSelectedIndicatorColors(getResources().getColor(R.color.colorPrimary));
mTabs.setViewPager(mPager);
}
activitymain.xml
<sarveshchavan777.inrerface2.SlidingTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
customtablayout.xml
<ImageView
android:id="@+id/imageTab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/textTab"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom|center" />