아래 보이는 틈을 제거하려고합니다. View
은 서로 마주보고 있으므로 drawable에있는 것 같습니다. stroke
의 width
과 관련되어 있음을 알 수 있습니다. 어떻게이 효과를 없앨 수 있습니까?Drawable Shape 라인의 간격을 제거하십시오.
이것은 MVCE 일 뿐이며 실제 사용 사례에서는 View
보다 작은 줄을 사용해야 함을 유의하십시오.
의심의 여지를 없애기 위해 나는 drawable xml로 해결하는 답변 만 수락합니다. 나는 레이아웃이 주위에 일하는 것을 원하지 않는다. 레이아웃은 단지 문제를 드러내는 것이다.
드로어 블/사진 line.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:width="5dp"
android:color="#ff0000"/>
</shape>
레이아웃/example.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/line">
</View>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/line">
</View>
</LinearLayout>
내 생각에 패딩 = 0 –