Android显示重复/复制的布局?

时间:2013-05-12 02:54:46

标签: android layout replication

首先,我想澄清一点,我对Android不是很有经验,但是,有没有办法在Android手机上复制/复制显示的布局?例如,我在主屏幕上,我的手机在屏幕上显示彼此相邻的两张相同图像。

这是我正在谈论的一个例子的图片。 (你可以忽略水印/框架的东西):

http://i1135.photobucket.com/albums/m637/mxmark825/Diagram.jpg

基本上我想要做的就是让手机显示2个布局,如果它在手机正面有2个独立的屏幕就可以了。

非常感谢任何想法/帮助。

1 个答案:

答案 0 :(得分:1)

您可以在单独的xml中定义布局,例如dup.xml,然后使活动布局xml如下所示:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <include layout="@layout/dup" />
    <include layout="@layout/dup" />
</LinearLayout>