2013-04-11 38 views
0

我想在我的項目中使用可跳動的滾動視圖(iPhone像)。我找到一些關於overscroll的文章,並使用它像This class here。但我不知道如何設置滾動視圖作爲其標題。如何在android中創建一個帶有標題的bouncable滾動視圖?

我也嘗試添加一個視圖,只是在我的自定義滾動視圖之前,但它沒有工作(代碼在最後)。

我需要一個視圖附加到滾動視圖我怎麼能做到這一點?任何想法將不勝感激。

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentTop="true" 
    android:background="#FF8080" 
    > 
    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 
</LinearLayout> 
<com.amix.tstsrc.MyScrollView 
    android:id="@+id/my_scrollView" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_centerHorizontal="true" 
    android:layout_centerVertical="true" 
    > 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="#8585FF"> 
     <TextView 
      android:id="@+id/help_text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="@android:color/white" /> 
    </LinearLayout> 
</com.amix.tstsrc.MyScrollView> 

回答

0

請通過https://github.com/Larphoid/android-Overscroll-ListView。我希望這是你正在尋找的。

如果您希望在標題保持不變的情況下使用標題進行滾動查看,並且列表滾動並彈出,則嘗試使用addHeaderView而不是滾動查看進行listview。

+0

謝謝,但我不希望頭留下來,我希望頭被隱藏,每次發生overscroll出現而不是** bold ** overScrollBy方法顯示的空白。像iOS – Amin 2013-04-12 06:53:22

+0

甚至可以看看[this](http://developer.schoolobile.com/2010/05/20/android-tutorial-making-your-own-3d-list-part-1/)教程。您將不得不修改代碼,因爲本教程是關於給列表視圖提供3d視圖的。 – MobDev 2013-04-12 12:41:09

相關問題