How to stop using AppCompat in Android Studio?

后端 未结 2 1939
旧时难觅i
旧时难觅i 2020-12-10 06:10

I\'m new to Android development and I\'m trying to follow Android development guide in Android Studio, specifically trying to set up an action bar.

2条回答
  •  隐瞒了意图╮
    2020-12-10 06:35

    Step #1: Change your theme away from Theme.AppCompat

    Step #2: Remove appcompat-v7 from your list of dependencies in your app module's build.gradle file

    Step #3: Change all activities to not inherit from AppCompatActivity or ActionBarActivity, but instead inherit from something else, like Activity

    Step #4: Change all menu resources, replacing app: with android:

    Step #5: Do a clean rebuild (Build > Clean Project) and fix any lingering compilation errors triggered by the above four steps

    Here is a sample project that uses the native action bar.

提交回复
热议问题