PercentRelativeLayout에 "widthPercent"또는 "heightPercent"가없는보기를 추가하려고하면보기가 표시되지 않습니다.PercentRelativeLayout에서 dp 너비 사용
내가 원하는 이유는 내 PercentRelativeLayout의 2 개 요소 사이에 1dp 너비의 구분선을 추가하기 위해서입니다.
<android.support.percent.PercentRelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout android:id="@+id/fragment_list_container"
app:layout_widthPercent="30%"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/divider"
android:layout_toStartOf="@+id/divider"/>
<View android:id="@id/divider"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@drawable/detailed_list_divider"
android:layout_toLeftOf="@+id/fragment_details_container"
android:layout_toStartOf="@+id/fragment_details_container"/>
<FrameLayout android:id="@id/fragment_details_container"
app:layout_widthPercent="70%"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:paddingBottom="@dimen/base_activity_padding"
android:paddingRight="@dimen/base_activity_padding"
android:paddingLeft="@dimen/base_activity_padding" />
</android.support.percent.PercentRelativeLayout>
그리고 내 분할에서 1 %로 "layout_widthPercent"을 설정하면이 표시됩니다 :
내가 사용하는 레이아웃이 있습니다. 그러나 나는 그것이 단지 1dp 만 취하기를 원한다. 이것을 달성하기위한 그들의 방법입니까?
감사합니다.
여기서는 dp가 작동하지 않을 것이라고 생각하지만, 0.01 %보기와 0.99 %와 같이 퍼센트를 사용할 수 있습니다. – Vickyexpert
0.01 %로 설정하면 일부 장치에 표시되지 않습니다. (아마도 0.01 %가 1dp보다 작습니다). – MHogge
위의 올바른 방법으로 적용하여 보관하십시오. 괜찮습니다. – Vickyexpert