2013-01-14 46 views
3

我有像播放商店應用程序的地方,有圖像和視頻查看傳呼機 和滾動查看詳細信息。不幸的是,當用戶滾動滾動是跳動,但如果我刪除滾動視圖查看傳呼機工作得很好。查看傳呼機嵌入滾動視圖時不光滑?

佈局的外觀和感覺是一樣的東西從服務器這個 http://cl.ly/MBRB

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" android:fillViewport="true"> 

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" > 



    <RelativeLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="160dp" 
     android:background="@drawable/loading_image" 
     android:gravity="top" 
     android:orientation="vertical" > 

     <android.support.v4.view.ViewPager 
      android:id="@+id/product_image_pager" 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent" /> 

     <com.viewpagerindicator.CirclePageIndicator 
      android:id="@+id/titles" 
      style="@style/CirclePageIndicator" 
      android:layout_alignParentBottom="true" 
      android:padding="10dip" 
      android:paddingBottom="10dp" /> 
    </RelativeLayout> 

    <include layout="@layout/app_screen_menu" /> 
</LinearLayout> 
</ScrollView> 

順便說一句我加載圖像。

感謝

+0

你可以發表你的佈局的屏幕截圖similair問題? – FoamyGuy

+0

Play商店不使用這樣的佈局。可滾動內容位於頁面內部,不在尋呼機外部。您可以通過實際使用Play商店應用程序來了解這一點 - 頂部的指示器不會滾動,就像您的方法一樣。我懷疑它也不使用'ScrollView',而是使用某種形式的'AdapterView'(可能是一個自定義的)。 – CommonsWare

+0

編輯與圖像http://cl.ly/MBRB – Preethi

回答

5

您正在使用2個scrollisteners

  • 一個viewpager使用scrolllistener
  • 滾動型使用scrolllistener

這兩個scrollistener都爭搶着表示ScrollEvent。 你可以通過執行onInterceptTouch來解決這個問題。在這種方法中,你可以決定誰贏在表示ScrollEvent

鬥爭看看這個protected post關於含2個scrollviews

+0

是的,100%真正的兄弟,我從xml設計端消除了我的滾動視圖,它完成了。 – Hiren