2014-01-20 246 views
0

我在某個網站上覆制了一個大文本,我想在單個文本視圖中顯示它。 ADT上的 。滾動查看textview

它顯示了基於Eclipse(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> 

的問題是,爲什麼它顯示了日食正確而我的標籤上它顯示錯了嗎?

+0

你爲什麼不使用字符串值XML? –

回答

1

這很可能是行結束字符的問題。您可能正在開發一個Windows機器並在基於Linux的物理機器上運行。

簡單的修復方法是在每行的末尾添加\n以強制系統正確打印新行字符。

而且你應該使用這個「string.xml」文件,但你仍然需要使用相同的修訂

+0

感謝您快速回復! :) – user3189176