Android actionbar not visible

后端 未结 17 2226
萌比男神i
萌比男神i 2020-12-18 18:23

I am trying to add an option menu in actionbar to my existing app but it is not working. If I create a new project with \"hello world\" default app I can see the button in a

相关标签:
17条回答
  • 2020-12-18 18:50

    i am using Samsung young 2 as android emulator and i have the same problem ,i reslov this by removing android:theme ="" from the manifest.xml and changing the theme to another theme support action bar

    0 讨论(0)
  • 2020-12-18 18:50

    You should extend AppCompatActivity.

    0 讨论(0)
  • 2020-12-18 18:51

    You have extended Activity. Try extending ActionBarActivity in java code

    0 讨论(0)
  • 2020-12-18 18:52

    What solved my issue in this regard was, in the design view, click the eye icon (view options) and select Show Layout Decorations.

    Image Showing the Eye Icon in the IDE of Android Studio 3.5

    0 讨论(0)
  • 2020-12-18 18:59

    you have to call the method setHasOptionsMenu(true); in the OnCreate Method

    0 讨论(0)
提交回复
热议问题