나는이 문제에 지금 어려움을 겪고있다. 매주 요일별 정보가 포함 된 5 개의 확장 가능한 목록보기가 있으며, 그 중 한 곳에서 스 와이프 할 수 있습니다. 모든 것은 잘 작동하지만, 내가 현재 목록보기가 자동으로 (사용자가 아님) 현재 날짜까지 스크롤되기를 바라는 것을 제외하고는 활동을 시작합니다. 그리고 ... 아무 일도 일어나지 않습니다.ExpandableListView cant 자동 스크롤
는 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