Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- kdoc-generator
- App Startup
- LOG
- application
- datastore
- prettyJson
- Blinking
- notification
- 이미지 gps
- jsontokotlinclass
- onReceivedSslError
- notification bar
- webview
- notification setting
- Plugins
- skipcollapsed
- requestPermission
- BottomSheetDialog
- ExifInterface
- itemAnimator
- navigation component
- onResume
- ActivityResultContracts
- room
- ChromeCustomTab
- circlecrop
- 403 Error
- Android
- shotcut
- Git
Archives
- Today
- Total
Debbi Story
ViewPager2 가 Fragment 안에 있을때 본문
728x90
기존에 ViewPager 어댑터로는
PagerAdapter, FragmentPagerAdapter, FragmentStatePagerAdapter 이렇게 3가지를 사용할 수 있었고,
새로운 ViewPager2에서는 RecyclerView.Adapter 와 FragmentStateAdpater 로 변경되었습니다.
FragmentStateAdpater 생성자 인자로 FragmentManager가 필요한데
ViewPager2가 Fragment 안에 있을경우 childFragmentManager 를 넣어주어야 합니다.
Activity 안에 있다면 supportFragmentManager 를 사용하면 됩니다.
'안드로이드 > Tip' 카테고리의 다른 글
Custom Notification bar 만들기 (0) | 2020.10.28 |
---|---|
Room Insert시 rowId 얻기 (0) | 2020.10.23 |
BottomSheetDialogFragment background 설정하기 (0) | 2020.09.10 |
DataBinding으로 layout_weight 값 적용하기 (0) | 2020.08.21 |
ViewPager2의 notifyDataSetChanged() 안될 때 (0) | 2020.08.18 |