1. res/values에 styles.xml을 추가한다.
2. styles.xml에 아래 코드를 넣어준다.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppCompat.Transparent.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
</style>
</resources>
3. AndroidManifest.xml에 투명하게 만들고자 하는 Activity에 앞서 만들어 둔 theme을 적용해준다.
<activity
android:name=".RateActivity"
android:exported="false"
android:theme="@style/Theme.AppCompat.Transparent.NoActionBar"/>
이렇게 해서 완성했다!
'안드로이드 노트' 카테고리의 다른 글
[안드로이드][프로젝트2]BottomNavigationView 색상 변경하는 법 (0) | 2022.04.10 |
---|---|
[안드로이드][프로젝트2] ratingBar 별 색깔 바꾸기 (0) | 2022.04.09 |
[안드로이드][프로젝트2] html 태그 없애는 법 (0) | 2022.04.07 |
[안드로이드][프로젝트2] TextView 긴 문자열 생략해서 표시하기 (0) | 2022.04.07 |
[안드로이드][프로젝트1]SharedPreferences를 이용하여 인트로 화면에서 바로 홈으로 넘어가기 (0) | 2022.03.26 |