【发布时间】:2017-01-23 10:27:37
【问题描述】:
我需要在slidingTabLayout 上放置一个按钮。我使用了 layout_below。但是,它没有用。请看一下我的 XML 和片段代码。
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<!-- TODO: Update blank fragment layout -->
<Button
android:id="@+id/charge_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/charge" />
<tabs.SlidingTabLayout
android:id="@+id/sliding_tabs"
android:elevation="1dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/charge_button"/>
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_height="wrap_content"
android:layout_width="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_below="@+id/sliding_tabs">
</android.support.v4.view.ViewPager>
</FrameLayout>
//Charge是这里的按钮名称
【问题讨论】:
标签: android android-layout android-viewpager android-xml