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

后端 未结 2 1327
借酒劲吻你
借酒劲吻你 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();

提交回复
热议问题