我希望将我的 Android 屏幕 (320*480) 分成两个 2 个屏幕,每个屏幕的分辨率为 320*240,这应该模仿 MS Word 的“分屏”功能。如何实现 任何示例代码或任何建议。 我将等待回复。
提前致谢。
最佳答案
如果分屏的大小是固定的,为什么不使用包含 2 个子布局的 LinearLayout
?
例子:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:id="@+id/TextView01" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Upper half" />
</LinearLayout>
<LinearLayout android:layout_height="fill_parent"
android:layout_width="fill_parent" android:layout_weight="1"
android:id="@+id/LinearLayout01">
<TextView android:id="@+id/TextView02" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="Lower half" />
</LinearLayout>
</LinearLayout>
看起来像
关于android - 如何为 Android 屏幕模仿 MS Word 的分屏功能。?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3666940/