android - 如何为 Android 屏幕模仿 MS Word 的分屏功能。?

标签 android

我希望将我的 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>

看起来像

alt text

关于android - 如何为 Android 屏幕模仿 MS Word 的分屏功能。?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3666940/

相关文章:

java - Android Wifi 带宽

android - Twitter4j : Send Direct Messages to more than 250 followers

android - 谷歌播放界面

安卓工作室 2.2.1 : Slow Debugging

java - 知道安装了哪些字体

android - 如何在不超过 Android 中的 VM 限制的情况下在 tabhost 中允许多个位图画廊?

android - 阻止 startActivity 的默认动画

android - 'gradlew' 不是内部或外部命令、可运行程序或批处理文件

java - 动画在onLongClickListener中不起作用

android - 根据当前位置和某个位置之间的距离更改 LocationRequest 的间隔