0

简单的是或否我认为就足够了,我知道我可以创建自己的选项卡并使它们看起来像新材料设计的选项卡并完全控制那里的位置,但我有点希望我可以使用支持库,我按照教程设置了我的材质选项卡,它们需要一些无光泽的抛光,但它们工作得很好。

截图 1

除了 id 实际上喜欢他们在我的应用程序视图中这样 -

截图 2

我试过嵌套视图,但到目前为止只能移动整个屏幕。

截图3

有没有人对此有快速修复或解决方法,或者这就是它的样子?

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout    
xmlns:android="http://schemas.android.com/apk/res/android"
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:fitsSystemWindows="true"
tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

    <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabMode="scrollable"
        app:tabGravity="fill" />

<android.support.v4.view.ViewPager
    android:id="@+id/viewpager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"  />


</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_main" />


<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="@dimen/fab_margin"
    android:src="@drawable/plus" />

  </android.support.design.widget.CoordinatorLayout>
4

1 回答 1

0

设法解决这个问题,因为我的选项卡嵌套在我的工具栏中,所以取出它使我能够将它们移动到我想要的位置

于 2016-04-27T11:54:42.410 回答