jsmarcus / Xamarin.Plugins

Cross platform Xamarin and Windows controls and plugins
MIT License
194 stars 79 forks source link

Resource.Id does not contain a definition for tabs #47

Open lreading opened 7 years ago

lreading commented 7 years ago

Great plugin, loving it!

In the getting started guide, it says to add this line in Android:

        FormsPlugin.Iconize.Droid.IconControls.Init(Resource.Id.toolbar, Resource.Id.tabs);

I'm on the latest version of Xamarin / Xamarin.Forms, and it's complaining that there's no definition for tabs. I've run it without providing a value and it is working fine (just using icon labels).

scavezze commented 7 years ago

I am also having the same issue. what exactly is this gonna break?

lreading commented 7 years ago

@scavezze - An educated guess here, but it will probably affect the tabbed controls: https://github.com/jsmarcus/Xamarin.Plugins/search?utf8=%E2%9C%93&q=IconControls.TabLayoutId

I'm using IconLabels without a problem at the moment.

KeaneGames commented 7 years ago

Assumming you have Id.toolbar, you probably have a tabs.axml and a toolbar.axml in your Resources/layout folder?

If so, make sure the id you use in there matches the id you're specifiying in code. e.g. if you have android:id="@+id/tabs" in it, you want to use Resource.Id.tabs, if you have android:id="@+id/sliding_tabs", you want to use Resource.Id.sliding_tabs, or change the id if your tabs.axml file.

If you don't have a tabs.axml file, see https://blog.xamarin.com/material-design-for-your-xamarin-forms-android-apps/

JosueMartinez commented 7 years ago

it is because tabs was changed for tabMode

vhugogarcia commented 7 years ago

The solution @JosueMartinez provided, worked for me.

Thanks Josue.