简体   繁体   中英

android studio and appcompat

Assuming I'm making a new android project from scratch that targets API 15-21, do I really need the compile 'com.android.support:appcompat-v7:21.0.3' in build.gradle ?

Can I remove it and not be worried about it?

do I really need the "compile 'com.android.support:appcompat-v7:21.0.3'" in build.gradle?

If you want a Material Design-styled action bar on API Level 7-20 (or, in your case, 15-20), then yes. Otherwise, for a minSdkVersion of 15, usually you do not need it.

Can I remove it and not be worried about it?

You can remove it, but you may need to adjust Java classes (eg, have your activities directly inherit from Activity , not from ActionBarActivity ), menu resources (use android: prefixes for everything, not app: prefixes), and themes (make sure they do not inherit from Theme.AppCompat ). Basically, anything in the project that depends upon appcomat-v7 needs to be adjust to no longer depend upon stuff in appcompat-v7 .

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