我需要显示滚动到特定项目的列表。
我该怎么做呢?
Ori
发布于 2011-04-12 03:43:21
您可以使用
listView.smoothScrollToPosition(specificPosition);发布于 2010-10-18 01:08:41
假设您正在使用listview小部件,那么您就可以调用列表视图的setSelection(position)了。
发布于 2011-05-04 17:20:13
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="?whiteBackground">
</LinearLayout>
<TextView android:id="@+id/textView1" android:layout_width="fill_parent" style="?textTitle" android:layout_height="wrap_content" android:text="Contents"></TextView>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="the following is content..."
style="?textSubheader"/>
<!-- You cannot have a ListView inside of a ScrollView. This LinearLayout acts like one. -->
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
> --> <ListView android:id="@+id/lv" android:textColor="#444444"
android:layout_height="270dip"
android:textStyle="bold"
android:cacheColorHint="#00000000" android:dividerHeight="2px"
android:layout_marginTop="5px" android:layout_width="fill_parent"
android:textSize="5px" android:layout_gravity="center">
</ListView>
<TextView android:id="@+id/any_old_widgetqss"
android:layout_width="fill_parent" style="?textTitle"
android:layout_height="40px" android:text="MCMS" android:background="@drawable/colorr"></TextView>
</LinearLayout>
</LinearLayout>
</ScrollView>https://stackoverflow.com/questions/2628741
复制相似问题