상세 컨텐츠

본문 제목

[ Kotlin, Java ] How to transparent Actionbar - 액션바 없애기 / 투명하게 만들기 (앱 전체화면 만들기)

Android/Kotlin

by SangHoonE 2021. 11. 3. 14:23

본문

반응형

 

values / style.xml

style.xml 파일을 하나 만들어주세요.

<?xml version="1.0" encoding="utf-8"?>
<resources>

<!-- Base application theme. -->
    <style name="ThemeActionBar"
        parent="Widget.AppCompat.Light.ActionBar.Solid">
        <item name="android:background">@null</item>
        <!-- Support library compatibility -->
        <item name="background">@null</item>
    </style>
</resources>

해당 내용을 작성합니다. 

@null 로 처리하여 없애버립니다(투명하게)

 

2. themes / themes.xml 

이곳으로 이동해주세요
이 아래에 작성해주세요.

 

<!-- Customize your theme here --> 아래에 작성해주세요

 

<!-- actionbar -->
        <item name="android:actionBarStyle">@style/ThemeActionBar</item>
        <item name="android:windowActionBarOverlay">true</item>
        <!-- Support library compatibility -->
        <item name="actionBarStyle">@style/ThemeActionBar</item>
        <item name="windowActionBarOverlay">true</item>

 

Avd 재구동! ( 에뮬레이터 )

 

 

 

원래는 있던 ActionBar가 사라진 것을 알 수 있습니다.

 

 

이전 모습 비교:

 

[ Kotlin, Java ] 안드로이드 스튜디오 - 비디오 배경화면 설정하기

mainActivity.kt val videoUri = Uri.parse("android.resource://" + packageName + "/" + R.raw.first ); binding.videoView.setVideoURI(videoUri); binding.videoView.start(); binding.videoView.setOnComplet..

code-hoon.tistory.com

감사합니다.

 

 

참고

 

Material Design Transparent ActionBar

I'd like to know if anyone knows how to make an activity with transparent action bar, like the one you have in the new Google Play Store when you go to an app's page. I don't care about the scroll...

stackoverflow.com

 

 

How to change the color of Action Bar in an Android App? - GeeksforGeeks

A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.

www.geeksforgeeks.org

 

관련글 더보기

댓글 영역