Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

UIButtonBarItem issue with image type

$
0
0

Hello. I have thi piece of code to add buttons to bottom toolbar:

stopButton = new UIBarButtonItem (UIImage.FromBundle ("9_av_play.png"), (o, e) => { Console.WriteLine("stop clicked"); });
playButton = new UIBarButtonItem (UIImage.FromBundle ("9_av_play.png"), (o, e) => { Console.WriteLine("play clicked"); });
pauseButton = new UIBarButtonItem (UIImage.FromBundle ("9_av_pause.png"), (o, e) => { Console.WriteLine("pause clicked"); });
snapButton = new UIBarButtonItem (UIImage.FromBundle ("10_device_access_alarm.png"), (o, e) => { Console.WriteLine("take snapshot clicked"); });
infoButton = new UIBarButtonItem (UIImage.FromBundle ("2_action_about.png"), (o, e) => { Console.WriteLine("take snapshot clicked"); });        

this.SetToolbarItems(new UIBarButtonItem[] {stopButton,playButton,pauseButton,snapButton,infoButton},false);
this.NavigationController.ToolbarHidden = false;

But compiler breack with this error: Error CS1502: The best overloaded method match for `MonoTouch.UIKit.UIBarButtonItem.UIBarButtonItem(MonoTouch.UIKit.UIBarButtonSystemItem, System.EventHandler)' has some invalid arguments (CS1502) I have seen some samples and they are using UUimage.FromBoundle to load custom image for Toolbars. Where do I'm wrong ? Please give me an hint. Max


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>