タイトルバーの設定は、レイアウトXMLに入れると思いがちですが、マニフェストXMLの方です。
設定方法
styles.xmlへ以下を追記します。
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar" 【1】 > <activity android:name=".TestActivity" android:noHistory="true" android:theme="@android:style/Theme.NoTitleBar" 【2】 > </activity>
【1】の方に設定値を入れるとアプリケーション全体に適応され、【2】に入れると、入れたアクティビティに適応されます。
Theme.NoTitleBarの代わりにTheme.NoTitleBar.Fullscreenを入れるとアンテナやバッテリー、時計の部分も非表示になります。
以上、Androidアプリのタイトルバーを非表示にする方法についてでした。