[英]Add shadows to bottoms tabs
这是我创建选项卡的代码(底部),工作正常。
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="10dp"
android:orientation="vertical">
<!-- Tab 1 content -->
<include layout="@layout/tab1" />
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="450dp"
android:orientation="vertical">
<!-- Tab 2 content -->
<include layout="@layout/tab2" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
</TabHost>
我已经以多种方式添加了height属性(到选项卡,tabHost,到布局...),但是它们都不起作用。 我在这里找到了一些解决方案,但没有一个适合我。 这个特定的代码有什么想法吗?
标高属性仅适用于具有背景的视图,但是您的视图是透明的。 您可以尝试为TabHost设置背景和高程,或者将整个标签栏放入AppBarLayout中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.