方法一
將styles.xml中的這行程式碼
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
修改為
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
方法二
在onCreate方法中加入
if (getSupportActionBar() != null){
getSupportActionBar().hide();
}