{"id":96,"date":"2018-01-04T13:18:22","date_gmt":"2018-01-04T04:18:22","guid":{"rendered":"http:\/\/oksisi2.ddns.net:8092\/wordpress\/?p=96"},"modified":"2019-12-21T18:58:52","modified_gmt":"2019-12-21T09:58:52","slug":"recyclerview%eb%a5%bc-ios%ec%9d%98-uipickerview-%ec%b2%98%eb%9f%bc-fade-in-fade-out-%ec%a0%81%ec%9a%a9%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/charlezz.com\/?p=96","title":{"rendered":"RecyclerView\ub97c iOS\uc758 UIPickerView \ucc98\ub7fc fade-in, fade-out \uc801\uc6a9\ud558\uae30"},"content":{"rendered":"<p>\ub864\ub9ac\ud31d \ucd9c\uc2dc \uc774\ud6c4\ub85c RecyclerView\uac00 \ub3c4\uc785\ub418\uace0 AdapterView\ub97c \ucee4\uc2a4\ud130\ub9c8\uc774\uc9d5 \ud558\uae30\uac00 \ud3b8\ud574\uc84c\ub2e4.<br \/>\n\uc624\ub298\uc740 UIPickerView \uc2a4\ud0c0\uc77c\ub85c RecyclerView\uc758 \ud22c\uba85\ub3c4\ub97c \uc8fc\uace0 \uc2f6\uc5b4\uc11c \ub808\uc774\uc544\uc6c3\ub9e4\ub2c8\uc800\ub97c \ub2e4\uc74c\uacfc \uac19\uc774 \uc801\uc6a9\ud588\ub2e4.<\/p>\n<pre class=\"\">class CustomLinearLayoutManager(context: Context) : LinearLayoutManager(context, VERTICAL, false) {\r\n   private fun updateChildrenAlpha() {\r\n      for (i in 0 until childCount) {\r\n         val child: View = getChildAt(i)\r\n         val bottom: Float = getDecoratedBottom(child).toFloat()\r\n         val top: Float = getDecoratedTop(child).toFloat()\r\n         val childCenter: Float = bottom + (top - bottom) \/ 2f\r\n         val center: Float = height \/ 2f\r\n         child.alpha = (center - Math.abs(center - childCenter)) \/ center\r\n      }  }\r\n   override fun scrollVerticallyBy(dy: Int, recycler: RecyclerView.Recycler?, state: RecyclerView.State?): Int {\r\n      updateChildrenAlpha()\r\n      return super.scrollVerticallyBy(dy, recycler, state)\r\n   }\r\n   override fun onLayoutChildren(recycler: RecyclerView.Recycler?, state: RecyclerView.State?) {\r\n      super.onLayoutChildren(recycler, state)\r\n      updateChildrenAlpha()\r\n   }\r\n}<\/pre>\n<p>\uac00\uc6b4\ub370\ub97c \uc911\uc2ec\uc73c\ub85c \uc704\uc544\ub798\uac00 \uc790\uc5f0\uc2a4\ub7fd\uac8c fade-in \uacfc fade-out \ub418\ub294\ubaa8\uc2b5\uc744 \ubcfc\uc218 \uc788\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\ub864\ub9ac\ud31d \ucd9c\uc2dc \uc774\ud6c4\ub85c RecyclerView\uac00 \ub3c4\uc785\ub418\uace0 AdapterView\ub97c \ucee4\uc2a4\ud130\ub9c8\uc774\uc9d5 \ud558\uae30\uac00 \ud3b8\ud574\uc84c\ub2e4. \uc624\ub298\uc740 UIPickerView \uc2a4\ud0c0\uc77c\ub85c RecyclerView\uc758 \ud22c\uba85\ub3c4\ub97c \uc8fc\uace0 \uc2f6\uc5b4\uc11c \ub808\uc774\uc544\uc6c3\ub9e4\ub2c8\uc800\ub97c \ub2e4\uc74c\uacfc \uac19\uc774 \uc801\uc6a9\ud588\ub2e4. class CustomLinearLayoutManager(context: Context) : LinearLayoutManager(context, VERTICAL, false) { private fun updateChildrenAlpha() { for (i in 0 until childCount) { val child: View = getChildAt(i) val bottom: Float = getDecoratedBottom(child).toFloat() val [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[5],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/96"}],"collection":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96"}],"version-history":[{"count":2,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions"}],"predecessor-version":[{"id":43826,"href":"https:\/\/charlezz.com\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions\/43826"}],"wp:attachment":[{"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/charlezz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}