A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
Is there a way to access this information from a SpanSizeLookup (without passing in extra variable)? How can I access the span size using only the position?
I cannot find this Api that get adapter Items in the GridLayoutManager.SpanSizeLookup without passing variable and getSpanSize.
We use myAdapter.GetItemViewType(position) to get items normally.
internal class MySpanSizeLookup : GridLayoutManager.SpanSizeLookup
{
private MyAdapter myAdapter;
public MySpanSizeLookup(MyAdapter myAdapter)
{
this.myAdapter = myAdapter;
}
public override int GetSpanSize(int position)
{
switch (myAdapter.GetItemViewType(position))
{
case MyAdapter.HEADER:
return 1;
case MyAdapter.ITEM:
return 2;
default:
return -1;
}
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.