728x90
class TransparentClass : BottomSheetDialogFragment() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle( // Background -> Transparent.
STYLE_NORMAL,
R.style.TransparentBottomSheetDialogFragment
)
}
}
style.xml
<style name="TransparentBottomSheetDialogFragment" parent="Theme.Design.BottomSheetDialog">
<item name="bottomSheetStyle">@style/TransparentBottomSheetDialogFragmentChild</item>
</style>
<style name="TransparentBottomSheetDialogFragmentChild" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">#00000000</item>
</style>
style.xml 에 위와같이 style 설정을 해주고
onCreate()에 setStyle 설정을 해준다.
위 예제에서는 BottomSheetDialog의 경우이다.
728x90
'Android > 가끔식 필요한 코드들' 카테고리의 다른 글
[Kotlin] Unicode To String 변환 (0) | 2021.08.25 |
---|---|
[Android] Android Status bar 검은색 or 제거하기 (0) | 2021.04.09 |
ViewPager - setOffscreenPageLimit(Fragment 의 생명주기 관리) (0) | 2020.12.13 |
[Android] menu 를 가진 layout 의 item 색상 변경 (0) | 2020.12.10 |
RecyclerView - item 위치 찾기 (0) | 2020.12.08 |
댓글