LinearLayout의 아이템 간에 Divider 노출에 아래 속성을 사용할 수 있다.
<LinearLayout
android:divider="..."
android:showDividers="..."
android:dividerPadding="...">
...
</LinearLayout>
<resources>
<declare-styleable name="LinearLayout">
...
<!-- 아이템 사이의 Divider로 사용할 수 있는 그리기 -->
<attr name="divider" />
<!-- 표시할 Divider 설정 -->
<attr name="showDividers">
<flag name="none" value="0" />
<flag name="beginning" value="1" />
<flag name="middle" value="2" />
<flag name="end" value="4" />
</attr>
<!-- Divider의 양쪽 끝에 있는 패딩 크기 -->
<attr name="dividerPadding" format="dimension" />
</declare-styleable>
</resources>
소스 출처 : https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/res/res/values/attrs.xml;l=4663-4673
<LinearLayout
android:divider="@drawable/shape_with_left_padding"
android:showDividers="...">
...
</LinearLayout>
<!-- shape_with_left_padding.xml -->
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="...">
<shape android:shape="rectangle">
...
</shape>
</inset>
comments powered by Disqus
Subscribe to this blog via RSS.
Jetpack Compose: LazyColumn/LazyRow 내부 코드 분석 ~ 2부 LazyList (2) rememberLazyListMeasurePolicy
Posted on 09 Feb 2025Jetpack Compose: LazyColumn/LazyRow 내부 코드 분석 ~ 2부 LazyList (1)
Posted on 25 Jan 2025Jetpack Compose: LazyColumn/LazyRow 내부 코드 분석 ~ 1부 LazyColumn/LazyRow
Posted on 10 Jan 2025