저는 잠시 동안이 문제에 시달렸으며 지금까지 답변을 찾을 수 없었습니다. RelativeLayout 안에 TableLayout이 있습니다. TableLayout을 스크롤 할 수 있도록해야합니다. 상대적 레이아웃이 아니기 때문에 정적 버튼이있어서 움직이는 것을 계획하지 않습니다. 중첩 된 레이아웃 ScrollView
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:layout_weight="1">
<RelativeLayout
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Encuestas" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="14dp"
android:layout_marginTop="14dp"
android:onClick="SyncServer"
android:text="Sync" />
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:id="@+id/TableLayout1"
android:layout_alignParentRight="true"
android:layout_below="@+id/button1" >
</TableLayout>
</RelativeLayout>
</ScrollView>
이 코드와 나는 전체 화면을 스크롤 할 수 있습니다,하지만 난 TableLayout을에있는 ScrollView를 넣어하려고하면, 나는 내가 만든 버튼을 클릭 드릴 수 없습니다.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Encuestas" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginRight="14dp"
android:layout_marginTop="14dp"
android:onClick="SyncServer"
android:text="Sync" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:layout_weight="1">
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:id="@+id/TableLayout1"
android:layout_alignParentRight="true"
android:layout_below="@+id/button1" >
</TableLayout>
</ScrollView>
</RelativeLayout>
이 버튼을 클릭하면 허용되지 않습니다. 어떤 제안?
을 나는 그것이 사실로 인해 아마 생각 ScrollView''그 'Button' 다음에 레이아웃에 추가되고 부모의 높이와 너비가 일치하도록 설정되어 z- 인덱스의'Button'보다 위에 있습니다. 'ScrollView' 다음에'Button'을 추가하십시오. –
감사합니다. Manveer Chawla. 나는 ScrollView가 버튼 앞에 있다는 사실을 잊어 버렸습니다. –
이 방법이 효과가 있다면 답변으로 게시해야합니까? :) –