Android Studio 3.5
Я хочу показать Tablayout с тенью внизу. Поэтому я пробую это:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical">
<include layout="@layout/appbar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/balanceTitleContainer"
style="@style/ImpressiveCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/default_gap"
android:layout_marginEnd="@dimen/default_gap">
<LinearLayout
android:id="@+id/baseTokenContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/baseTokenTokenView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="19sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/default_gap"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/topUpButton"
style="@style/PrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="2dp"
android:layout_weight="0.5"
android:text="@string/topUp"
android:textSize="12sp"
android:theme="@style/PrimaryButton.Overlay" />
<Button
android:id="@+id/sendButton"
style="@style/PrimaryButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="2dp"
android:layout_weight="0.5"
android:text="@string/send"
android:textSize="12sp"
android:theme="@style/PrimaryButton.Overlay" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:elevation="@dimen/line_divider_shadow_height"
app:tabMode="scrollable"
app:tabTextColor="@color/colorAccent">
<android.support.design.widget.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_vauchers" />
</android.support.design.widget.TabLayout>
макет панели приложения xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/appbar"
style="@style/AppbarTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/toolbar" />
</android.support.design.widget.AppBarLayout>
Я использую
android:background="@color/white"
android:elevation="@dimen/line_divider_shadow_height"
, чтобы показать тень.
здесь результат:
![enter image description here](https://i.stack.imgur.com/rOj9W.jpg)
Как вы можете видеть в Tablayout, сверху также показана серая линия (над My Vaucher ). Но мне нужна серая линия (тень) только внизу Tablayout.