私は一番下にあるボタンを作ろうとしており、すべてのフラグメントに表示されます。これは、フラグメントを含むアクティビティのxmlレイアウトです。フラグメントはスクロール可能で、下のボタンは常に表示されます。すべてのフラグメントに表示されるボタンを作るandroid
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_store_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.sendbest.ibooking.ibooking_customer.StoreInfo">
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/viewpagertab"
android:layout_width="match_parent"
android:layout_height="48dp"
app:stl_indicatorAlwaysInCenter="false"
app:stl_indicatorWithoutPadding="false"
app:stl_indicatorInFront="false"
app:stl_indicatorInterpolation="smart"
app:stl_indicatorGravity="bottom"
app:stl_indicatorColor="#ff4081"
app:stl_indicatorThickness="4dp"
app:stl_indicatorWidth="auto"
app:stl_indicatorCornerRadius="2dp"
app:stl_overlineColor="#4D000000"
app:stl_overlineThickness="0dp"
app:stl_underlineColor="#4D000000"
app:stl_underlineThickness="1dp"
app:stl_dividerColor="#4D000000"
app:stl_dividerThickness="1dp"
app:stl_defaultTabBackground="?attr/selectableItemBackground"
app:stl_defaultTabTextAllCaps="true"
app:stl_defaultTabTextColor="#4D000000"
app:stl_defaultTabTextSize="12sp"
app:stl_defaultTabTextHorizontalPadding="16dp"
app:stl_defaultTabTextMinWidth="0dp"
app:stl_distributeEvenly="false"
app:stl_clickable="true"
app:stl_titleOffset="24dp"
app:stl_drawDecorationAfterTab="false"
/>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/viewpagertab"
/>
<Button
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_below="@id/viewpager"
android:gravity="bottom"
android:text="bottom button"
android:background="#e50013"
android:id="@+id/btShopping"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
タブとビューページャーは正常に動作しますが、ボタンは表示されません。これを適用する正しい方法は何ですか?
ありがとうございます、私はlayout_aboveを入れてみましたが、layout_belowを削除しませんでした。これは解決しました。私はあなたの答えを受け入れてくれるでしょう。 – JerryKo
素晴らしいです。常に準備ができている:) –