MvxGridView 용 사용자 지정 어댑터를 구현해야합니다.MvxGridView 용 사용자 지정 어댑터
이 어댑터는 바인드 된 유형에 따라보기를 확장하고 이미지 자원을 설정해야합니다.
GetViewMvxAdapter에 그냥 무시할 수 있습니까?
public override View GetView(int position, View convertView, ViewGroup parent)
{
var inflater = (LayoutInflater)this.Context.GetSystemService(Context.LayoutInflaterService);
var productNode = (ProductNode)this.GetRawItem(position);
if (productNode.NodeType == ProductNodeType.Folder)
{
return inflater.Inflate(Resource.Layout.GridFolderItem, parent);
}
else
{
View documentItemView = inflater.Inflate(Resource.Layout.GridDocumentItem, parent);
var imageView = documentItemView.FindViewById<MvxImageView>(Resource.Layout.GridFolderItem);
switch (productNode.NodeType)
{
case ProductNodeType.Unknown:
throw new InvalidOperationException("Node type hasn't been initialized");
case ProductNodeType.Image:
// Set matching image
break;
case ProductNodeType.Pdf:
break;
case ProductNodeType.Parts:
break;
default:
throw new InvalidOperationException(
string.Format("Unhandled node type '{0}'", productNode.NodeType));
}
return imageView;
}
}
아니면 내가 GetBindableView를 오버라이드 (override) 할 필요가? 정말 부모 뷰 그룹이없는 인플레이션에 대처하는 방법을 알고하지 않는 경우
...