【问题标题】:Android Tabs with transparent blurred background具有透明模糊背景的 Android 选项卡
【发布时间】:2013-12-23 12:57:31
【问题描述】:

我想显示透明的模糊标签,以便它后面的listactivity屏幕显示模糊图像

和没有分隔线的标签。

【问题讨论】:

  • 那些看起来不一定是选项卡,它们可以用普通布局实现。你哪里有问题?
  • 我想在我的整个应用程序中使用这个视图,我将如何管理 25 个活动。
  • 标签没有模糊,它们只是透明的黑色

标签: android-layout android-tabhost android-tabs android-tabstrip


【解决方案1】:

我找到了一个解决方案,方法是从取消选择事件中删除项目选择器背景,并且您要在选项卡组的背景中设置的图像只需通过使用设置背景资源来使用该图像。

在选择器中进行更改

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/selected_tab" android:state_selected="true" />
    <item android:drawable="@android:color/transparent" />
</selector>

在标签主机中进行以下更改

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
   android:id="@android:id/tabhost"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:background="#000000" >
   <RelativeLayout
       android:id="@+id/linearLayoutTab"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:orientation="vertical" >
       <FrameLayout
           android:id="@android:id/tabcontent"
           android:layout_width="fill_parent"
           android:layout_height="fill_parent" />
       <TabWidget
           android:id="@android:id/tabs"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:layout_alignParentBottom="true"
           android:layout_marginBottom="-10dp"
           android:tabStripEnabled="true"
           android:background="@drawable/unselected_tab"/>
   </RelativeLayout>
</TabHost>

【讨论】:

    猜你喜欢
    • 2014-01-28
    • 1970-01-01
    • 2015-03-18
    • 2018-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-05
    相关资源
    最近更新 更多