LoginSignup
0
0

More than 1 year has passed since last update.

【Android Studio】アプリケーションのタイトルバーを削除・横画面固定する方法

Posted at

概要

Webviewを導入することになったので詰まった箇所を残していきます

今回はAndroidStudioで起動したアプリケーションのタイトルバーの非表示方法と横画面を固定化する方法をまとめます

アプリケーションのタイトルバーの非表示

src/main/res/values/themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
    <!-- Base application theme. -->
    <style>
        <!--   タイトルバーの退避    -->
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>

横画面を固定化する

以下を追加する

android:name=".MainActivity"
android:screenOrientation="landscape"
src/main/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <uses-permission android:name="android.permission.INTERNET" />
    <application>
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:screenOrientation="landscape"
            >
        </activity>
    </application>
</manifest>
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