android 顶部和底部布局透明化
使用RelativeLayout布局做成顶部和底部透明,设置如下:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- 顶部布局 -->
<RelativeLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="@dimen/display_photo_bottom_height"
android:layout_alignParentTop="true"
android:background="#ac080808">
</RelativeLayout>
<!-- 底部布局 -->
<RelativeLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_alignParentBottom="true"
android:background="#ac080808">
</RelativeLayout>
</RelativeLayout>位置不能出现错位,如果先把header放上面,后面的会把前面的部分覆盖,类似CSS的3D模型
相关推荐
安辉 2020-01-25
西木 2011-04-06
berber 2014-05-14
ThedakeLaugh 2011-09-27
nickey 2012-02-09
fengyeezju 2020-03-01
fengyeezju 2020-02-03
李良逸 2013-07-23
GoAheadY 2010-08-21
gongzhiyao0 2010-11-15
安辉 2014-01-07
xz0mzq 2011-10-31
qjbagu 2018-05-18
hong 2018-04-23
qjbagu 2016-11-04
Palingenesis 2019-06-27
OliverLau 2019-06-27