2017-04-05 1 views
0

content_main에서 탐색 서랍 작업을 사용하고 있습니다. 단편 레이아웃으로 인해 하나의 선형 레이아웃이 있습니다.다른보기의 스크롤에서 조각보기 숨기기

content_main.xml

<?xml version="1.0" encoding="utf-8"?> 
<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:id="@+id/content_home" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context="net.techdesire.khabargujarat.HomeActivity" 
    tools:showIn="@layout/app_bar_home"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/fragment_container"/> 

</RelativeLayout> 

fragment_home.xml는

<android.support.percent.PercentRelativeLayout 
    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="match_parent" 
    android:layout_height="match_parent" 
    tools:context="fragment.HomeFragment"> 

     <android.support.v4.view.ViewPager 
      android:id="@+id/viewpager" 
      android:layout_width="match_parent" 
      app:layout_heightPercent="40%"/> 


     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:padding="5dp" 
      app:layout_heightPercent="60%" 
      android:layout_below="@+id/viewpager"> 

      <TextView 
       android:id="@+id/about" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="5dp" 
       android:text="@string/about_khijadiya" 
       android:textAppearance="@style/TextAppearance.AppCompat.Large"/> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/about" 
       android:text="@string/dummy" 
       android:textAppearance="@style/TextAppearance.AppCompat.Medium"/> 
     </RelativeLayout> 
</android.support.percent.PercentRelativeLayout> 

나는 약이라는 텍스트 뷰에서 많은 내용이있다. image.First에서와 같이 스크롤 가능하게 만들고 싶습니다. 먼저 상대방을 전체 화면으로 스크롤하고 약 내용이 여전히 오버플로되면 textview를 스크롤 가능하게 만듭니다. 스크롤이 위로 올라갈 때 사용자가 아래로 스 와이프하면 뷰 페이지를 다시 표시합니다.

enter image description here

+0

내가 당신이 원하는 것을 이해하지 못했다 :

당신은이 링크를 참조 할 수 있습니다. 다른 방법을 설명해 주시겠습니까? –

답변

0

나는 스크롤하는 동안 귀하의 요구 사항은보기를 붕괴되고, 생각합니다.

"android.support.design.widget.CollapsingToolbarLayout"을 사용할 수 있습니다.

재료 설계로 구현됩니다. http://www.androidhive.info/2016/05/android-working-with-card-view-and-recycler-view/

+0

네, 그렇지만 정확하지는 않습니다. 툴바와 다른 것들을 조작하고 싶지 않았습니다. 하나의 XML 파일 만 변경하면됩니까? –

+0

네,하지만 그것은 당신의 관점에 달려 있습니다. –

관련 문제