pocheshire / BottomNavigationBar

Bottom Navigation Bar for Xamarin
214 stars 70 forks source link

Error inflating class #13

Closed ilyagolod closed 8 years ago

ilyagolod commented 8 years ago

I wanna set the bar up in my app but it gives an exception when it reaches the line _bottomBar.SetItems(Resource.Menu.bottombar_menu);. The exception is "Android.Views.InflateException: Binary XML file line #1: Error inflating class ". What may this problem be about?

pocheshire commented 8 years ago

@Iliort Can you provide your bottombar_menu.xml file?

ilyagolod commented 8 years ago

@pocheshire At first I thought that problem was associated with it too. So trying to debug it I used the one from your sample but the error remained the same.

Anyway, here is it but I guess you're kinda familiar with it)

bottombar_menu.zip

pocheshire commented 8 years ago

@Iliort So, I can't repeat this.

ilyagolod commented 8 years ago

@pocheshire

  1. I tried to use the exact code from your sample but the exception kept appearing.
  2. But demo works fine
  3. I tried deleting (doesn't work)

It seems like it may be about some application settings but I tried to copy from the demo as much as possible (the manifest, resources, etc.). Maybe you can try to create the bar in a totally clear project (just the bar and nothing else). If it works, I will just be able to compare it with mine and see what's different. Thanks in advance)

pocheshire commented 8 years ago

@Iliort ok, I'll try create clean project. One more question – what version of BottomBar you use"?

ilyagolod commented 8 years ago

@pocheshire 1.1.2 I downloaded it via NuGet

pocheshire commented 8 years ago

@Iliort See this sample. It was created for other issue but it's clean solution and it doesn't contains it bug.

Maybe the reason for a bug in the device? On what device you are testing project?

ilyagolod commented 8 years ago

@pocheshire I'll check out the demo, thanks! I run it on LG G4 (Android 5.1). But I don't think this is a problem since your sample works fine there.

rileytaylor commented 8 years ago

@pocheshire I am having this issue as well, on the same point (_bottombar.SetItems) both if I attempt to define my menu in code or in .axml. I've followed your sample/readme instructions in adding it to my project.

pocheshire commented 8 years ago

@rileytaylor can you provide your project?

pocheshire commented 8 years ago

@Iliort problem persists?

rileytaylor commented 8 years ago

@pocheshire Yep, here it is. Not much else implemented aside from some mvvmlight and a little bit of UI. StatusBoardApp.Droid.zip

pocheshire commented 8 years ago

@Iliort @rileytaylor SOLVED

You MUST use AppCompat Theme in your app

See how it work (more interesting is style.xml and AndroidManifest.xml)

ice-j commented 7 years ago

This still bothers me, why am I bound to the AppCompat theme? @pocheshire ?

pocheshire commented 7 years ago

@ice-j answer

cullenjohnson commented 7 years ago

Thanks @pocheshire ! You saved me a headache. :)