2013-05-27 15 views
2

我在我的應用程序中有一個垂直滾動的textview。運行良好,但沒有任何「動畫」,所以看起來不是很漂亮。我怎樣才能實現流暢的動畫?如果需要:如何使一個平滑的可滾動textview?

了java:

TextView textscroll = (TextView) rootView.findViewById(R.id.textscroll); 
      textscroll.setText(getCPUinfo()); 
      textscroll.setMovementMethod(new ScrollingMovementMethod()); 

和XML:

<TextView 
    android:id="@+id/CPUinfo"  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="10dp" 
    android:maxLines="10" 
    tools:ignore="SelectableText" /> 

回答

-1

請嘗試將TexView滾動型的孩子!

<ScrollView> 
    <TextView> 
    </TextView> 
</ScrollView> 

就是這樣。您的文本應該像任何其他可滾動的Android應用程序一樣滾動您在到達TextView的末尾時使用經典的藍色或橙色燈光知道。

+0

我不知道爲什麼,但對我來說這種方法不會:( –