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

ActionBar with SupporLibrary Error: No resource found that matches the given name

$
0
0

Hi all, I've been trying add in my app ActionBar with SupportLibrary. It's my full code: `using System; using Android.Content; using Android.Runtime; using Android.Views; using Android.Widget; using Android.OS; using Android.Support.V7.App; using Android.Support.V4.App; namespace AndroidApplication4 { [Android.App.Activity(Label = "AndroidApplication4", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/Theme.AppCompat.Light")] public class Activity1 : ActionBarActivity, ActionBar.ITabListener { ActionBar actionBar; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); RequestWindowFeature(WindowFeatures.ActionBar); actionBar = this.SupportActionBar; ActionBar.Tab tab1 = actionBar.NewTab(); tab1.SetText("tab1"); tab1.SetTabListener(this); actionBar.AddTab(tab1); ActionBar.Tab tab2 = actionBar.NewTab(); tab1.SetText("tab2"); tab1.SetTabListener(this); actionBar.AddTab(tab1); } public void OnTabReselected(ActionBar.Tab tab, FragmentTransaction ft) { }

    public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
    {
        switch (tab.Position)
        {
            case 0:
                //Show content of tab1
                break;

            case 1:
                //Show content of tab2
                break;

            default:
                break;
        }
    }

    public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft)
    {
    }
}

}` But i've getting: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.AppCompat.Light'). I've tried write different name of themes and start my project with different minimum android version. Help me please. Thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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