xamarin - Using Android Toolbar -
i'm following following tutorial implement toolbar:
http://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/
when write code things cannot resolved.
protected override void oncreate (bundle bundle) { base.oncreate (bundle); setcontentview (resource.layout.main); var toolbar = findviewbyid<toolbar> (resource.id.toolbar); //toolbar take on default action bar characteristics setactionbar (toolbar); //you can use , reference actionbar actionbar.title = "hello toolbar"; }
unresolved things are: base, setcontentview, findviewbyid, toolbar, resource. cant import them.
the first letters of "setcontentview", " findviewbyid" small. findviewbyid() method takes arguments like: findviewbyid(r.id.your_view_name);
and not findviewbyid(resource.id.your_view_name);
basically, try changing resource.id.your_view "r.id.your_view". also, make first letters of method names small
Comments
Post a Comment