include屬性用法
Android的layout中, 能夠使用include屬性樣式, 這樣能夠把不同的layout拼接在一起.
能夠進行layout的複用, 可是須要注意的是layout屬性是"layout", 前面不能加入"android:layout".
代碼:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/activity_start_ask"/>
<include layout="@layout/layout_promptcover_voice"/>
</FrameLayout>
