易采站长站为您分析android编程实现局部界面动态切换的方法,以实例形式较为详细的分析了Android局部切换的布局及功能实现技巧,具有一定参考借鉴价值,需要的朋友可以参考下
本文实例讲述了android编程实现局部界面动态切换的方法。,具体如下:
局部界面固定,局部界面可以动态切换。效果如下:



这个效果由3个layout构成
main.xml
- <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://www.easck.com/apk/res/android"
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- android:orientation="horizontal" > <LinearLayout
- android:layout_width="fill_parent" android:layout_height="fill_parent"
- android:layout_weight="1" android:background="@android:color/black" >
- <Button android:id="@+id/btnSwitch"
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:text="switch" /> <Button
- android:id="@+id/btnScreen" android:layout_width="wrap_content"
- android:layout_height="wrap_content" android:text="screen" />
- </LinearLayout> <LinearLayout
- android:id="@+id/frameSwitch" android:layout_width="160dp"
- android:layout_height="fill_parent" android:background="@android:color/white" >
- </LinearLayout> </LinearLayout>










