1
스크롤 영역에 왼쪽 파란색 패널과 녹색 오른쪽 패널이 나타납니다. 하지만 왼쪽 패널의 높이는 0입니다. 어떻게 수정해야하는지 알고 있습니까?ScrollView에서 RelativeLayout 자식 높이가 0입니다.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFFFF"
android:fadeScrollbars="false"
android:fillViewport="true" >
<RelativeLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFF0000" >
<View
android:id="@+id/right_panel"
android:layout_width="100dp"
android:layout_height="20000dp"
android:layout_alignParentRight="true"
android:background="#FF00FF00" />
<View
android:id="@+id/left_panel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toLeftOf="@id/right_panel"
android:background="#FF0000FF" />
</RelativeLayout>
</ScrollView>
스크롤 할 수 있기를 원합니다. –
RelativeLayout을 LinearLayout (수평)으로 변경하십시오. – Bhavin
왼쪽 패널의 아래쪽과 위쪽을 오른쪽 패널에 맞추어야하는 솔루션을 발견했습니다. <보기 안드로이드 : ID = "@ + ID/left_panel" 안드로이드 : layout_width = "match_parent" 안드로이드 : layout_height = "match_parent" 안드로이드 : layout_toLeftOf = "@ 아이디/right_panel" 안드로이드 : layout_alignTop = " @ id/right_panel " android : layout_alignBottom ="@ id/right_panel " android : background ="# FF0000FF "/> –