I am using a custom Listview
with Custom views
as list elements, each list item is a separate Custom view
. The problem which I am facing is , click event on button in 1st item of ListView is not getting fired when we click on it. After clicking on it if we click somewhere else in the screen the click event get fires. I am not able to find the solutions for it and I am struggling with it. Any help will be highly appreciated.
Updated with code: Here is the getview method
public override View GetView(int position, View convertView, ViewGroup parent)
{
if (position == 0)
{
convertView = this.context.LayoutInflater.Inflate(Resource.Layout.home_hero_container, null);
this.heroSection = convertView.FindViewById<FrameLayout>(Resource.Id.heroContainer);
this.setHeroCard();
}
else
{
convertView = (View)GetItem(position - 1);
}
return convertView;
}
GetItem
returns CustomView. 1st item will be the hero layout, after that all the Customviews
will be added to Convertview
. Click event is not working on the 1st item after hero.
Update with my answer:
Instead of assigning Customview
directly on to Convertview
I inflated a FrameLayout
and add Customview
to FrameLayout
. Now I don't have click issue.