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 |
Tags
- onResume
- skipcollapsed
- Git
- ChromeCustomTab
- Android
- prettyJson
- circlecrop
- ExifInterface
- jsontokotlinclass
- ActivityResultContracts
- kdoc-generator
- requestPermission
- itemAnimator
- notification setting
- webview
- notification bar
- notification
- room
- datastore
- shotcut
- BottomSheetDialog
- Blinking
- LOG
- 403 Error
- 이미지 gps
- navigation component
- onReceivedSslError
- application
- Plugins
- App Startup
Archives
- Today
- Total
목록layout_weight (1)
Debbi Story
DataBinding으로 layout_weight 값 적용하기
안드로이드 LinearLayout 사용시 비율을 주고싶을때 사용하는 속성! layout_weight이 있습니다. 타입은 float형으로 되어있는데요. 저는 DataBinding과 ViewModel을 사용해 값을 변경해주고 싶었지만 오류가 생깁니다!! 아래 처럼 BindingAdapter를 사용하면 됩니다! object MainBindings { @JvmStatic @BindingAdapter("android:layout_weight") fun setLayoutWeight(view: View, weight: Float) { val layoutParams = view.layoutParams as? LinearLayout.LayoutParams layoutParams?.let { it.weight = weig..
안드로이드/Tip
2020. 8. 21. 21:13