2013-07-03 41 views
0

我想讓我的自定義列表視圖滾動中的textview。在自定義列表中自動滾動TextView

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:descendantFocusability="blocksDescendants" 
android:orientation="horizontal" 
android:padding="10dp" > 

<TextView 
    android:id="@+id/listview_patientname" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentTop="true" 
    android:layout_marginTop="26dp" 
    android:ellipsize="marquee" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:hint="Patient Name" 
    android:marqueeRepeatLimit="marquee_forever" 
    android:minWidth="120dp" 
    android:scrollHorizontally="true" 
    android:singleLine="true" 
    android:textAppearance="?android:attr/textAppearanceSmall" /> 

以上是我的XML代碼。我將我的列表視圖被選中。

上面的xml和設置不在listview滾動的textview一起。

有沒有解決方案?由於

回答

0

嘗試使用此:

<ScrollView 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" > 

    <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" > 

     </RelativeLayout> 
    </ScrollView> 

滾動型只能包含一個孩子。所以把另一個佈局,然後把你的意見。

+0

嗨,我不太明白答案。我必須把我的textview放在relativelayout中?如果有這種情況,我不需要在我的cutom listview中爲每個textview需要1個scrollview和layout。 – sean

+0

將您的所有視圖放在RelativeLayout下的ScrollView中,並且它們都可以滾動。 – dasdasd