当前位置: 代码迷 >> Android >> android 顶部跟底部布局透明化
  详细解决方案

android 顶部跟底部布局透明化

热度:18   发布时间:2016-04-27 22:49:10.0
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模型
  相关解决方案