Using support action bar home enabled

后端 未结 5 2250
花落未央
花落未央 2021-02-08 13:31

I\'ve just modified our code to use the new SupportActionBar provided in the v7-appcompat library but when running the code on a Jellybean phone (presumably the same problem exi

5条回答
  •  遇见更好的自我
    2021-02-08 13:54

    Now Please try this. Cause I was able to solve my own problem like this though it was on Sherlock. From your styles above I can see you did some customization to your themes. In my case I did some customization to my Sherlock theme and this was what gave me problem cos on android 4.0 and above my theme failed. so I simple added a piece of code that tells android to use the default Sherlock theme when it is running on android 4.0 and greater. So I suppose this would work for you. you tell android to use the default theme of v7-appcompat library on the version of android that is not working for you.

    Code is below:

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
                this.setTheme(R.style.Theme_Sherlock);
            } else {
                this.setTheme(R.style.Theme_Sherlock_Light_DarkActionBar);
    
            }
    

    In your case edit the theme to v7-appcompat library.

    Please Mark as answer if it work for you. I believe it might be possible to customize the theme from the code for places were you are using this.

提交回复
热议问题