简体   繁体   中英

Android: Expanding and collapsing toolbars without AppCompat library

In my application I'm using the theme @android:style/Theme.Material because I like the dark material design.

I would like to implement an expanding and collapsing toolbars like the one in "Build a Material Design App with the Android Design Support Library" from Codelab.

http://imgur.com/1JHP0cP.gif

The problem is that it's require the widget CoordinatorLayout that seems to be incompatible with this theme.

Is there any solution that doesn't require to change the theme ?
If not, is it possible to have a dark material look with AppCompat ?

I replaced @android:style/Theme.Material by Theme.AppCompat and add appcompat-v7 in my dependencies. Also I replaced every extends Activity by extends AppCompatActivity in my java code.

Now my application can run without this error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM