왼쪽 창은 Listview이고 오른쪽 창은 세부 사항보기 인 SlidingPaneLayout이 있습니다. XML은 다음과 같습니다.SlidingPaneLayout의 Listview 부분에 너비를 100 %로 설정하는 방법
문제는 - 어떻게 전체 화면을 커버하기 위해리스트 뷰의 너비를 만들 수 있습니까? 아래에서 볼 수 있듯이 (빨간색 화살표) 현재 너비는 화면 오른쪽으로 이동하지 않습니다.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SlidingPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/sliding_pane_layout"
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<!--
The first child view becomes the left pane. When the combined
desired width (expressed using android:layout_width) would
not fit on-screen at once, the right pane is permitted to
overlap the left.
-->
<LinearLayout
android:id="@+id/ll_left_pane"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginRight="0dp" >
<ListView
android:id="@+id/left_pane"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginRight="0dp" />
</LinearLayout>
<!--
The second child becomes the right (content) pane. In this
example, android:layout_weight is used to express that this
pane should grow to consume leftover available space when the
window is wide enough. This allows the content pane to
responsively grow in width on larger screens while still
requiring at least the minimum width expressed by
android:layout_width.
-->
<!-- Framelayout to display Fragments -->
<FrameLayout
android:id="@+id/frame_container_slidingpanedetailview"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
</android.support.v4.widget.SlidingPaneLayout>
좋아,하지만 난 화면 폭을 감지하는 자바에 특별한 코드를 추가하고 설정해야 궁금 그것 이상이거나 1000dp와 같은 큰 가치는 그것을 돌볼 것인가 아닌가를 결정할 것입니다. 감사합니다. 대답으로 표시됩니다. – user1406716
화면 너비를 프로 그램 할 수 있습니다. 하지만이 설정은 화면이 반영되기 전에 슬라이딩 패널에 주어져야하므로 화면에 반영되는 것은 의심 스럽습니다. 그래서 상대 너비 값이 여기에서 작동하지 않습니다. –