반응형
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 |
Tags
- Aplha
- 코틀린
- 회전 센서
- RecyclerView
- 온라인IDE
- powercfg
- utf8mb4
- 자기장 센서
- Android Studio 3.6
- phpstorm
- mysql 5.7
- ARGB
- Kotlin
- 자격증
- 온라인에디터
- lateinit
- Android
- 동영상 실행
- LayoutParmas
- Exoplayer
- 온라인무료코딩사이트
- 온라인코딩
- 걸음 감지 센서
- setBackgroundResource
- 웹코드빌드
- 금속 탐지기 센서
- BottomSheetDialog
- 걸음수 감지 센서
- 광 센서
Archives
- Today
- Total
Memory
[ANDROID/KOTLIN] layout_weight 코드로 수정하기 본문
반응형
fun setWeight(data: ItemListTop_Data){
// LinearLayout layout_weight 코드 설정 방법
// val layoutParams = 변수명.layoutParams as LayoutParams
// layoutParams.weight = 2f
val layoutParams = linearL_item_list_top.layoutParams as LayoutParams
layoutParams.weight = data.layout_weight
}
[참고]
출처 :
stackoverflow.com/questions/3224193/set-the-layout-weight-of-a-textview-programmatically
Set the layout weight of a TextView programmatically
I'm trying to dynamically create TableRow objects and add them to a TableLayout. The TableRow objects has 2 items, a TextView and a CheckBox. The TextView items need to have their layout weight set...
stackoverflow.com
stackoverflow.com/questions/13016216/how-to-programmatically-set-weight-for-button
How to programmatically set weight for Button
I need to implement Dialog for my Android app through Java code, so I can't use XML. I have root LinearLayout where I implement range seek bar, then I have another LinearLayout under root layout, ...
stackoverflow.com
반응형
'IT > ANDROID' 카테고리의 다른 글
[ANDROID] 샘플 무료 동영상 경로 공유 (1) | 2021.01.12 |
---|---|
[ANDROID/KOTLIN] 배경 색상 코드로 수정하기 (setBackgroundResource) (0) | 2021.01.12 |
[ANDROID/KOTLIN] lateinit 초기화 여부 확인 (0) | 2021.01.11 |
[ANDROID/KOTLIN] Android Sensor 종류 (가속도, 근접, 걸음 감지, 걸음수 감지, 광, 회전, 자기장/금속탐지기, 중력, 진동, GPS 거리 측정, 기압) (0) | 2020.08.25 |
[ANDROID] How to set color programmatically in Android (코드로 색상 설정하기) (0) | 2020.03.06 |