Scrollview textview

时间:2014-01-20 18:04:32

标签: java android eclipse

我在某个网站上复制了一个大文字,我想在一个文本视图中显示它。 在ADT上。

它在日食(adt)上显示正确

Docs1

然后在我的标签上。 (导出apk)

Docs2

这是我的XML:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#02222f"

>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="20sp"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#FFFFFF"
        android:text="
        Audio
        Android's audio Hardware Abstraction Layer (HAL) connects the higher level, audio-specific framework APIs in android.media to the underlying audio driver and hardware.\n

        The following figure and list describe how audio functionality is implemented and the relevant source code that is involved in the implementation.

        Application framework
        At the application framework level is the app code, which utilizes the android.media APIs to interact with the audio hardware. Internally, this code calls corresponding JNI glue classes to access the native code that interacts with the audio hardware.

        JNI
        The JNI code associated with android.media is located in the frameworks/base/core/jni/ and frameworks/base/media/jni directories. This code calls the lower level native code to obtain access to the audio hardware.

        Native framework
        The native framework is defined in frameworks/av/media/libmedia and provides a native equivalent to the android.media package. The native framework calls the Binder IPC proxies to obtain access to audio-specific services of the media server.

        Binder IPC
        The Binder IPC proxies facilitate communication over process boundaries. They are located in the frameworks/av/media/libmedia directory and begin with the letter I.

        Media Server
        The audio services in the media server, located in frameworks/av/services/audioflinger, is the actual code that interacts with your HAL implementations.

        HAL
        The HAL defines the standard interface that audio services call into and that you must implement to have your audio hardware function correctly. The audio HAL interfaces are located in hardware/libhardware/include/hardware. See audio.h for additional details.

        Kernel Driver
        The audio driver interacts with the hardware and your implementation of the HAL. You can choose to use ALSA, OSS, or a custom driver of your own at this level. The HAL is driver-agnostic."/>


</LinearLayout>


</ScrollView>

问题是,为什么它在我的标签上显示正确的日食显示错误?

1 个答案:

答案 0 :(得分:1)

这很可能是行尾字符的问题。你可能正在开发一台Windows机器并在一台基于linux的物理机器上运行。

简单的修复方法是将\n添加到每行的末尾,以强制系统正确打印新的行字符。

此外,你应该使用'string.xml'文件,但你仍然需要使用相同的修复