Xamarin.Plugins icon indicating copy to clipboard operation
Xamarin.Plugins copied to clipboard

Forms-Android Toolbar click not working

Open khawtf opened this issue 7 years ago • 8 comments

iOS works perfectly.

In the main activity of android i have added this:

//Iconize
Plugin.Iconize.Iconize.With(new Plugin.Iconize.Fonts.FontAwesomeModule());
FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar,Resource.Id.sliding_tabs);

I initiate the pages with the IconNavigationPage instead of the NavigationPage

	<ContentPage.ToolbarItems>
		<iconize:IconToolbarItem Icon="fa-comments-o" IconColor="White" Clicked="Handle_FeedbackClick" />
		<iconize:IconToolbarItem Icon="fa-tags" IconColor="White" Clicked="Handle_ClaimsClick" />
	</ContentPage.ToolbarItems>

I can see the Icons and the toolbar but the click doesnt do anything at all. If I replace the IconNavigationPage back to NavigationPage and use normal toolbar items the clicks work again.

What is this sorcery ?

khawtf avatar Apr 06 '17 20:04 khawtf

Really nobody had this problem :| ?

khawtf avatar Apr 08 '17 00:04 khawtf

Activate and Click don't work.

Workaround: Use the Command function.

khawtf avatar Apr 08 '17 09:04 khawtf

Same problem here, Clicked don't work if IconNavigationPage is used.

DomResc avatar Apr 13 '17 09:04 DomResc

You can use Command and refer to the method. Works the same

khawtf avatar Apr 13 '17 14:04 khawtf

@DomResc did you stick to NavigationPage instead?

JosueMartinez avatar May 22 '17 22:05 JosueMartinez

I can confirm this doesn't work.

In my case, I needed the event and cannot use a Command. Is anyone looking at this?

akamud avatar Aug 31 '17 18:08 akamud

Command binding works the first time, but nothing fired after then :(

tuyen-vuduc avatar Sep 10 '17 05:09 tuyen-vuduc

The same thing :S. @tuyen-vuduc if you add an IconToolbarItem instance in a ContentPage programmatically, it works. For instance:

 ToolbarItems.Add(new IconToolbarItem 
{ 
                Icon = "fa-building", IconColor = Color.White, Command = new 
                Command(OnToolbarItemClick) 
});

castrojr913 avatar Nov 19 '17 04:11 castrojr913