LoginSignup
0
0

Android タイトルバーを表示する

Posted at

Android studioでAndroidアプリを制作していて、タイトルバーがデフォルトで表示されない設定となっていました。なので、表示させる方法を紹介します。

プロジェクト作成時にEmpty Views Activityを指定した想定で進めます。
スクリーンショット 2024-04-18 19.58.52.png

1. Androidビューでファイルを開いてthemes.xmlファイルを探す

themes.xmlファイルはapp/res/values/themeフォルダに格納されています。
スクリーンショット 2024-04-18 20.03.44.png

2. themes.xmlファイルの編集

themes.xmlファイルの下記のコードを修正します。
(変更前)

  <style name="Base.Theme.ViewSample" parent="Theme.Material3.DayNight.NoActionBar">

(変更後)

<style name="Base.Theme.ViewSample" parent="Theme.Material3.DayNight">

NotActionBarを消すことで、タイトルバーが表示されるようになります。

参考
Android タイトルバーを隠す AppCompatActivity編

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0