开发者

Scrolling in a TextView Inside a ListView

开发者 https://www.devze.com 2023-02-08 04:03 出处:网络
I have a listview which has a scrollbar. Inside the listview each item/row has 2 textviews of which the third textview is scrollable.

I have a listview which has a scrollbar. Inside the listview each item/row has 2 textviews of which the third textview is scrollable.

i am setting the data to the listview using an Array Adapter.

But i am not able to scroll the textview.

My listview looks like:-

<ListView android:id="@+id/list" android:layout_width="480dip" android:cacheColorHint="#00000000"
        android:layout_height="60dip"  android:scrollbarFadeDuration="1000000"/>

My xml which i am using to inflate the view is

<LinearLayout android:layout_width="fill_parent"
    android:layout_height="wrap_content" android:id="@+id/rowlayout_row2"
    android:orientation="horizontal" android:weightSum="1.0"
    android:gravity="center">
    <TextView android:id="@+id/textview1"
        android:layout_width="0dip" android:gravity="center"
        android:layout_weight="0.3" android:layout_height="wrap_content"
        android:textColor="#5C5C5C" android:text="Commenmts "
        android:textSize="12dip" android:typeface="sans" android:paddingTop="3dip"
        android:paddingLeft="3dip" />
    <TextView android:id="@+id/review_data_id" android:scrollbars = "vertical"
        android:layout_width="0dip" android:gravity="left" android:maxLines="2"
        android:layout_weight="0.6" android:layout_height="wrap_content" 
        android:layout_toRightOf="@+id/textview1" android:textColor="#5C5C5C"
        android:textSize="12dip" android:typefa开发者_C百科ce="sans" android:paddingTop="3dip"
        android:paddingLeft="3dip" />
</LinearLayout>

I have tried to make it fosuble but that did not work..


Don't put one scrollable container into another scrollable container as it will not work. You have an UI design flaw if you encounter such a problem which means that you should rethink your UI.

0

精彩评论

暂无评论...
验证码 换一张
取 消