2013-01-11 51 views
0

這是我用Samsung GT-I9003L時遇到的一個奇怪問題。我有一個包含LinearLayout的ScrollView,裏面有不同的東西(ImageView,Button,EditText等等),它在2.3.3和4.2版本的模擬器中測試都是完美的。Android ScrollView overscroll indicator問題

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/scroll_view" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:padding="16dp" > 

     <ImageView 
      android:id="@+id/image" 
      android:layout_width="fill_parent" 
      android:layout_height="200dp" 
      android:contentDescription="@string/img_description" 
      android:src="@drawable/ic_launcher" /> 

     <Button 
      android:id="@+id/btn_camera" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/add_new_btn_camera" /> 

     <Button 
      android:id="@+id/btn_gallery" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/add_new_btn_gallery" /> 

     <EditText 
      android:id="@+id/name" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:ems="10" 
      android:hint="@string/add_new_name_hint" 
      android:inputType="text" 
      android:maxLength="80" /> 

     [...] 
    </LinearLayout> 

</ScrollView> 

事情是,當我在手機上測試它時,超卷指標(藍色/橙色發光)根本不顯示。我已經成功地讓他們這一行的工作:

ScrollView addNewScroll = (ScrollView)findViewById(R.id.scroll_view); 
addNewScroll.setOverScrollMode(ScrollView.OVER_SCROLL_IF_CONTENT_SCROLLS); 

但是,當我到達山頂或結束,輝光只是「出現」,它沒有動畫或

感謝變淡。提前爲您提供幫助!

+1

我猜這是因爲三星在他們的手機中放置的UI(TouchWiz?)......它以某種方式覆蓋了Android的默認設置 – user219882

+0

我不會懷疑這一點。每個製造商都應該遵守這些標準,但他們不這樣做。問題是,其他應用程序工作正常... –

回答

0

我們有完全相同的問題。 Overscolling在三星Galaxy 2(Touchwiz)上似乎不起作用,但在HTC One X手機上也是如此(HTC的老款似乎有效)。

懷疑他們用自己的ScrollView實現替代了ScrollView實現,也許是用於伸縮滾動條或其他東西。

+0

你知道一個自定義的方法,使其工作?謝謝! –

+0

您可以從AOSP的ScrollView中抓取一份副本,並將其與您的應用程序一起打包。因此,您提供了自己的ScrollView副本,而不是提供者提供的副本。 – Jeroen

+0

對不起,遲交的答案。我會試試看看會發生什麼。謝謝你的提示! –