2017-11-13 5 views
0

에 의해 차단하기 : XMLFile1.xml를있는 ScrollView는이 같은 디자인이 선형 레이아웃

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:id="@+id/option_view" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

    <ScrollView 
    android:name="question_paper_scrollView" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true"> 

    <FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/fragment_container" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"/> 
    </ScrollView> 
</RelativeLayout> 

내가 this 또한 설정에 따라 ScrollView에서 android:fillViewport="true"을 설정 한

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="fill_parent" 
android:layout_height="match_parent"> 
    <include layout=XMLFile1.xml> 
    <LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" 
    android:gravity="center|bottom" 
    android:weightSum="4"/> 
</RelativeLayout> 

XMLFile2.xml this에 따라 의 minimumHeight()FrameLayout은 퀴즈 질문을 보유하고 스크롤 할 수 있어야하며 LinearLayout은 다음, 이전 및 삭제와 같은 버튼 집합으로 구성됩니다. 나는 thisLinearLayout에서 ScrollView을 숨길 수 있지만 ScrollBar를 볼 수 있습니다. 달성 할 수있는 올바른 방법은 무엇입니까? 추 신 : LinearLayout을 사용하도록 제한되어 있습니다. 왜냐하면 화면 하단에 버튼 세트가 필요하고 데이터베이스에서 퀴즈 질문을 동적으로로드하기 때문에 FrameLayout을 사용하기 때문입니다.

해결 방법 : 답안 모두를 조합하십시오. 모든 레이아웃에서 wrap_content를 사용하고 선형 레이아웃의 사용자 layout_below 속성을 사용하십시오.

+0

레이아웃의 속성을 표시합니다. – Dabiuteef

+0

@Dabiuteef는 속성을 추가했습니다 –

+0

아마도 이것도 가능합니다 : LinearLayout의 android : layout_height를 wrap_content로 변경하고 android : layout_above = ""를 include 태그에 추가하십시오. – Dabiuteef

답변

1

bringToFront()을 호출 할 수 있습니다. 뷰가 차단되지 않으면 bringToFront()을 호출 할 수 있습니다. 또는 android:height 개의보기를 조정하십시오. ScrollView도 android:layout_below="@id/includeView"

+0

죄송합니다. @Elias Fazel하지만 작동하지 않았습니다. –

+0

내 프레임 레이아웃이 완전히 숨겨졌습니다. –

+1

그래서 제가 말씀 드렸듯이 view of height 및 set layout_below –

1

으로 설정하십시오. 두 XML 파일에서 fill_parent 또는 match_parent 대신 모든 레이아웃과 뷰의 높이 wrap_content를 사용하십시오.

+0

LinearLayout은 아래쪽 탭과 같은 기능을하는 버튼입니다. 다음을 클릭하면 새 질문이 프레임에로드됩니다. LinearLayout의 높이를 wrap_content로 만들면 모든 버튼이 위로 올라갑니다. 스크롤 뷰는 버튼까지만 작동하고 버튼 아래의 텍스트를 표시하는 데는 넘어 가지 않습니다. –

+0

선형 배치에 어떤 방향을 부여합니까? –

+0

Horizantal orientation. 세로로 변경하면 단추가 다른 단추 위에 쌓입니다. 아래의 탭 버튼에 선형 레이아웃을 사용했습니다 : https : //stackoverflow.com/questions/18944692/android-tabs-in-bottom-of-screen –