2014-01-22 30 views
3

我有幾個三星設備(GT-I9192/4.2.2,GT-I9295/4.2.2等)用於測試目的,它們都不會顯示HorisontalScrollView的衰落邊緣。所有其他智能手機,如宏達電,摩托羅拉,魅族等(主要是aos 4.x和幾個2.3.5)顯示衰落的邊緣。
由於api14新的屬性添加android:requiresFadingEdge,它有沒有代碼的替代(至少我沒有發現它)即時通訊使用下面的佈局(用於標籤滾動此滾動):Android setHorizo​​ntalFadingEdgeEnabled不能與三星

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/tabs_horisontal_scroll_view" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@color/white" 
    android:fadingEdge="horizontal" 
    android:fadingEdgeLength="32dp" 
    android:fillViewport="true" 
    android:layerType="software" //was thinking it might help but it doesn't 
    android:requiresFadingEdge="horizontal" 
    android:scrollbarAlwaysDrawHorizontalTrack="true" 
    android:scrollbars="none" /> 

就像我說任何智能手機的一切工作正常,但不是在三星的。其實三星設備確實繪製了fadingEdge,並且它在所有三星設備上看起來都一樣,但它看起來像它的最大寬度爲2-3px。所以我注意到它會繪製它,但不是32dp,它忽略了有關FadingEdge設置的所有內容。可能唯一關閉的是運作良好。
那麼這有什麼問題?

+0

你有沒有解決這個問題?正如你所提到的,它不適用於三星設備。 – surlac

+0

我沒有找到任何解決方案,所以它看起來像你必須手動繪製邊緣(如在PhotoShop中),並以編程方式將其包含在邊緣處的圖像中。 – Stan

回答

0

嘗試使用android:overScrollMode屬性。

只需添加

android:overScrollMode="always" 

HorizontalScrollView

android:overScrollMode可以有三個值:「always」,「never」,「ifContentScrolls」。

+0

我無法檢查它,因爲我沒有這些三星設備了。不過,我認爲這也無濟於事。就像我在我的問題中提到的那樣,三星顯示fadingEdge,但它太薄,所以它大多不明顯。所以這個問題主要是關於邊緣配置(在三星設備上它似乎不可配置)。 – Stan

+0

這不起作用。 – CoDe

相關問題