android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/layout_top"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" >
添加顶部内容
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/layout_top" >
这里可以添加scroll的内容
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
添加底部内容
有哪行不懂可以问我
分两种情况:
如果加载的时候不使用切换动画,或者说切换时整个界面都跟着动。
这时候可以写一个BaseActivity,把上面和下面部分放在里面实现,对应一个布局common_bar.xml,在BaseActivity里面去实例化并添加对应事件处理。其余的每个activity需要用到此上下的,都继承BaseActivity.
如果加载的时候使用切换动画,而且切换时只有中间部分有切换效果。
这时候只能写一个activity,中间部分用一个容器来动态加载就好了。
布局实现:
最外层用RelativeLayout,底部layout设置在与父容器底部对齐,设置一个高度为100dp。
中间部分layout设置在顶部layout的下方,宽高都match_parent,并且距离底部100dp。
这样就实现了你的要求,至于layout里面具体的实现应该不用我说了吧,很简单了。
大致可以是