【发布时间】:2015-06-25 23:59:19
【问题描述】:
我在我的 android 应用程序中使用视图寻呼机、fragmentpageradapter 和滑动选项卡布局。我希望为我的滑动选项卡布局设置不透明度,以便您可以在背景中看到部分可滚动内容——我想要把它也弄模糊了,虽然我是一步一步来的。现在,当我为我的 xml 分配不透明度时,在我的背景颜色中,它为我的图标而不是图标后面的背景分配了不透明度。我该如何解决这个问题??
这是我的 xml:
<wxyc.wxyc_consolidate.TabLayoutTools.SlidingTabLayout
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@id/wxyc"
android:layout_gravity="center"
android:background="#ffcbcbcb"
android:gravity="center"
android:layout_alignParentBottom="true"
/>
这里是我实现slidingTabs的地方:
MyFragmentPagerAdapter fragmentPagerAdapter = new MyFragmentPagerAdapter(getSupportFragmentManager(),
MainActivity.this, liveStreamFragment);
// getSupportFragmentManager allows use to interact with the fragments
// MyFragmentPagerAdapter will return a fragment based on an index that is passed
viewPager.setAdapter(fragmentPagerAdapter);
// Initialize the Sliding Tab Layout
SlidingTabLayout slidingTabLayout = (SlidingTabLayout) findViewById(R.id.sliding_tabs);
slidingTabLayout.setCustomTabView(R.layout.custom_tab, 0);
slidingTabLayout.setDistributeEvenly(true);
slidingTabLayout.setBackgroundColor(Color.rgb(202, 202, 212));
slidingTabLayout.setFillViewport(true);
slidingTabLayout.setViewPager(viewPager);
slidingTabLayout.setViewPager(viewPager);
【问题讨论】:
标签: android view tabs pager sliding