【问题标题】:Custom Buttons with vewpager in TableLayoutTableLayout 中带有 vewpager 的自定义按钮
【发布时间】:2020-09-23 13:03:00
【问题描述】:

我有一个带有 TableLayout 的应用程序,但我无法与设计中的相同,我将在下面放置链接

我的 XML:

<RelativeLayout
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="16dp"
        android:fitsSystemWindows="true"
        android:background="@drawable/back"
        tools:context=".MainActivity">

        <com.google.android.material.tabs.TabLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:tabMode="fixed"
            android:clipToPadding="true"
            android:clipChildren="true"
            app:tabIndicatorHeight="0dp"
            app:tabSelectedTextColor="@android:color/white"
            app:tabTextColor="@android:color/white"
            app:tabBackground="@android:color/transparent"
            app:tabGravity="fill"/>
    </RelativeLayout>

有什么想法吗?

【问题讨论】:

  • 你想让你的标签(demo,new,..)显示在工具栏里面吗?
  • @Wini 是的,和上图一模一样
  • 你能发布完整的xml代码和你到目前为止所做的截图吗?

标签: java android android-tablelayout


【解决方案1】:

我认为您唯一的选择是使用 3 个按钮创建一个自定义视图并自己完成所有导航。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-31
    • 2014-02-09
    • 2020-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多