LegacyBar Error Theme

Can anyone help?
I'm using the component LegacyBar.
Everything is working perfect, but when I try to set the theme for Holo.Blue
I get the error: Error: No resource identifier found for attribute 'theme' in package 'legacybar.sample' (Our Guide).

Has anyone experienced this? I am using Xamarin Studio.

The code is in axml:
<? xml version = "1.0" encoding = "utf-8"?>

<LegacyBar.Library.Bar.LegacyBar
style = "@ style / ActionBar"
android: id = "@ + id / ActionBar"
ab: theme = "holo_blue" /> <----------------- here is generating the error

Posts

  • CheesebaronCheesebaron DKInsider, University mod
    edited November 2013

    Please format that code, it is unreadable.

    But the problem seems to be that attr.xml from the Library project is not being recognized, and hence when setting any of the ActionBar specific stuff in the layout will not work.

    Try cleaning the project and build it again. Otherwise, you can set the theme stuff yourself with:

    legacyBar.SeparatorColorRaw = Resource.Color.actionbar_separator_blue;
    legacyBar.TitleColorRaw = Resource.Color.actionbar_title_blue;
    legacyBar.ItemBackgroundDrawableRaw = Resource.Drawable.actionbar_btn_blue;
    legacyBar.BackgroundDrawableRaw = Resource.Drawable.actionbar_background_blue;
    legacyBar.DropdownDrawableRaw = Resource.Drawable.dropdown_btn_holo_dark;
    

    Where legacyBar is the bar instance itself.

    I've worked with the code directly from the repo today, and themes etc. worked.

  • JamesMontemagnoJamesMontemagno USForum Administrator, Xamarin Team, Developer Group Leader Xamurai
    edited November 2013

    In your axml change:
    xmlns:ab="http://schemas.android.com/apk/res/legacybar.sample"

    to
    xmlns:ab="http://schemas.android.com/apk/res-auto"

    That should fix it up for you. I just made a sample and that seemed to work.

    I think @Cheesebaron just needs to fix that up in the sample

  • CheesebaronCheesebaron DKInsider, University mod

    @JamesMontemagno is probably right. I didn't catch that because of the scrambled code in the opening post.

  • OXMTecnologiaOXMTecnologia BRMember ✭✭

    Thanks @JamesMontemagno, worked perfectly!

    Thanks @Cheesebaron. In future posts the code will be formatted.

Sign In or Register to comment.