Я сейчас борюсь с этой проблемой ridiculos. Я получил 5 расширяемых списков, которые содержат информацию для каждого дня недели, и я могу провести между ними. Все работает очень хорошо, за исключением того, что когда я запускаю действие, я хочу, чтобы текущий просмотр списка автоматически прокручивался (а не пользователем) до текущего дня. И ... НЕТ.ExpandableListView не может автоматически прокручиваться
SSCCE:
public void Test()
{
for (int i = 0; i < this.numberOfWeeks; i++)
{
// Relative layout to represent the current visible area
RelativeLayout screen = new RelativeLayout(this);
//LayoutParameters for the screen, fills the whole screen
RelativeLayout.LayoutParams newParams = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.FillParent, RelativeLayout.LayoutParams.FillParent);
screen.Id = 1000;
screen.LayoutParameters = newParams;
//An ExpandableListView is created with some parameters not important for this example
ExpandableListView newEListView = this.CreateExpandableListView(//..params..//)
screen.AddView(newEListView);
// Set this newEListView to the array of expandablelistviews
this.expandableListViews[i] = newEListView;
}
// Some more stuff is done, and finally when data is loaded and everything shows up just fine..
// Lets make it automatically scroll down to the current day!
// This does nothing
this.expandableListViews[3].SetSelection(4); // 4 is current day
// Same here
this.expandableListViews[3].SetSelectionFromTop(4, 200);
}
Может быть стоит отметить, что ручной скроллинг работает просто отлично ..
Я боюсь, что такого метода нет в Monodroid .. :( –
http://androidapi.xamarin.com/?link=M%3aAndroid.Widget.AbsListView.SmoothScrollToPosition%28System.Int32%29 – jpobst