转载请注明出处:王亟亟的大牛之路
以前,我们如果要对一个界面切割,分成各个部分可能需要画好多个Layout然后include进来或者用个什么空白的ImageView去填充。V7包中有了一个更简便的实现
包结构:
就2个按钮分别去到2个不能布局方式的layout,呈现样式不贴了,因为一模一样。。
要是使用LinearLayoutCompat的话需要引入compile 'com.android.support:appcompat-v7:22.2.1'
eclipse的话去搜刮jar包就好
OneActivity的布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background=