mercredi 4 mai 2016

Open gridview on click of another grid view in xamarin(android)

I am new in Android as well Xamarin grid view with image and text

on click of grid view wont to open new activity with another grid view grid view with image and text

ImageAdadapter.cs

 public class ImageAdapter : BaseAdapter
    {
     public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View view;

            if (convertView == null)
            {  
                view = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.My_Grid_row, parent, false);

            }
            else
            {
                view = convertView;
            }


            var imageView = view.FindViewById<ImageView>(Resource.Id.my_image_view);
            imageView.SetImageResource(thumbIds[position]);

            var Hastagtext = view.FindViewById<TextView>(Resource.Id.my_text_view);
            Hastagtext.SetText(MainTagsName[position]);

            //imageView.SetImageResource(thumbIds[position]);
            return view;
        }

        // references to our images
        int[] thumbIds = {
        Resource.Drawable.Icon, Resource.Drawable.Icon,
    };
        int[] MainTagsName = {
    Resource.String.Custom_tab_label,
            Resource.String.Custom_tab_label, Resource.String.All_tab_label

        };
    }

But i don't know how to do that.plese help me.

Aucun commentaire:

Enregistrer un commentaire