android
[android] Fragment 모서리 둥글게
tbMaster
2020. 7. 3. 18:01
반응형
Fragment를 다이얼로그처럼 만들기로 했다. 그리고 모서리를 둥글게 적용하기 위해서 레이아웃의 background 에 corner를 작성한 drawable 파일을 넣었는데... 직각이 그대로 표출 @.@!!!
그래서 찾아보니... 레이아웃에 대한 작업 + Fragment 내에서 inflate할 때, 추가 작업을 해야 한단다...
해보자!!
Fragment 파일 내에 위와 같이 setBackgroundDrawable의 ColorDrawable을 TRANSPARENT 로 투명하게 설정해주면 모서리가 나타나지 않는다.
* 참고로 안드로이드 버전이 4 이하일 경우, Blue Line이 나타난다는데... 그럴경우는 아래 stackoverflow를 참고하자.
Custom FragmentDialog with round corners and not 100% screen width
I am creating a custom fragment dialog with round corners and with layout that would not fill the screen width (I would prefer if it just wrapped its content). this is my rounded_dialog.xml in dra...
stackoverflow.com
반응형