Difference between support.v7.widgets and android.widgets Toolbar, Fragment

后端 未结 2 1328
借酒劲吻你
借酒劲吻你 2020-12-31 21:39

I am creating a new application and will have to deal with ActionBar. I know that I have to extend the AppCompatActivity because the ActionBarActivity is deprecated, however

相关标签:
2条回答
  • 2020-12-31 21:47
    • Support.V7.widgets and widgets.android both are different libraries.
    • support.v7.widgets uses design library.
    • toolbar actually not an actionbar we are manually implementing a ActionBar with support library.
    • And there are lot more new inbuilt properties are included like observableScrollActivity and More material designs...,

    • Why we aren't using default actionbar?

      Because ActionBarActivity is depricated. Comparing old actionbar with our latest sdk actionbar it gives good look.

      .setSupportActionBar(toolbar);

    After Setting support to the toolbar gives actionbar properties to the toolbar like we can hide it by getSupportActionBar().hide();

    0 讨论(0)
  • 2020-12-31 22:09

    First of all you are asking Good Question, Android will add advanced features continuously in different API levels but those features are available from which level of API they are added

    For Example: Consider android fragment functionality was added in API level 11 that means it will work for API level 11 and above but your application need for API level 10 devices also at that time it wont be work. For this reason android develop support library for cover a wide range of Android devices (support for low level API) to work those functionality.

    Android always recommend developers to use support library for development for more information check here

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