This is a question related to the production of the Android app.

Asked 1 years ago, Updated 1 years ago, 113 views

Hello, brothers.

Even if I make an app and release it, you can see it

The purple frame (?) that displays the name of the app file is continuously visible, so the completeness of the app is reduced due to the aesthetics<

I made it with empty activity, but it's like that ㅠ<

Do I have to set it up or change the activity? The image is an example.

android-studio java emulator

2022-09-20 22:31

2 Answers

This purple frame is provided as an app bar provided in the form of an action bar. For information on the role of the Appbar, please read the following article. https://developer.android.com/training/appbar?hl=ko

There are two typical ways.

First of all, simply in the code of an activity

Java:

getSupportActionBar().hide();

Kotlin:

supportActionBar.hide()

You can do it.

The second way is to change the theme of the activity. I don't think you touched the theme-related settings because the color of the app bar is purple.

If you open the app/manifests/AndroidManifest.xml file, the properties of the application tag should include the following:

    ...
    android:theme="@style/AppTheme">

This is a setting that states that the entire app uses a theme called AppTheme. We need to change the theme, so we should go to the place where App Theme is, right?

If you open the app/res/style.xml file, you can guess the following.

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

If you change the theme that AppTheme inherits by default from Theme.AppCompat.Light.DarkActionBar to Theme.AppCompat.Light.NoActionBar, that is,

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
...

If you change it like this, you can see that the purple frame you mentioned disappears.


2022-09-20 22:31

Google

android activity without actionbar

Search it like this and find it yourself.

There are many ways.


2022-09-20 22:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.