scrollview不置頂

scrollview  裏的 LinearLayout加這 2個屬性 
 android:focusable="true"
 android:focusableInTouchMode="true"

或者重寫scrollview 

public class DefScrollView  extends ScrollView {
    public DefScrollView(Context context) {
        super(context);
    }

    public DefScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public DefScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected int computeScrollDeltaToGetChildRectOnScreen(Rect rect) {
        return 0;
    }
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章