使用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模型
分享到:
相关推荐
android顶部和底部导航栏
android fragmen 仿IOS微信底部布局
Android 顶部底部均有Tab标签 http://blog.csdn.net/geofferysun/article/details/41826451
Android实现了仿百度贴吧的悬浮式顶部和底部标题栏的效果,项目中含:源码+效果图+项目结构图 教程地址:http://blog.csdn.net/yangyu20121224/article/details/9122517
绝对可以用在项目,代码精炼,很少有人愿意把这个分享给别人
Android仿照新浪微博底部布局,自己写的。适合很多项目。
实现了顶部、底部菜单左右滑动及ListView内嵌GridView
模仿考试应用的底部+顶部Tab布局,适合新手学习布局之用,GB编码
android fragment 使用以及嵌套使用 底部菜单和顶部菜单,类似微信和QQ的分页菜单
android 底部弹出菜单(带透明背景)
Android TabLayout、ViewPager实现顶部和底部Tab导航 http://blog.csdn.net/RichieZhu/article/details/50966690
http://blog.csdn.net/yanjunhui2011/article/details/78274608 对应资源
android 底部顶部切换,有点类似微博的发现页,发现中间有顶部的切换,由于不是很清楚,这个整了很久才整出来的,当时也是网上各种找demo,不好找啊。
Android实现了仿百度贴吧的悬浮式顶部和底部标题栏的效果.zip,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
Android仿微信底部菜单栏+顶部菜单栏,效果看博文http://blog.csdn.net/evankaka/article/details/44121457
DialogFragment实现底部弹窗 DialogFragment底部弹窗的开发模板,Created by C.L. Wang
继承tabActivity 实现的底部布局
可顶部和底部显示的Snackbar
Android从屏幕底部滑动弹出PopupWindow,有动画效果,类似于sharesdk的分享页面滑动弹出效果。
Android顶部、底部标签,自定义Dialog、Snackbar、Toast,悬浮按钮,展示图伸缩效果,发送消息界面效果,登录界面效果等。