how to increase carousel image space?

前端 未结 3 967
独厮守ぢ
独厮守ぢ 2021-01-03 13:29

I downloaded sample android carousel demo source code in below link carousel demo source code link

my doubt is if I add more images, images gap is very low so how to

3条回答
  •  一向
    一向 (楼主)
    2021-01-03 14:27

    Thank you all for your answers, especially Sen ,lepert.. I fix the issue of false selection of click with large images .Your solution is very much useful if the user needs to get the images untouched only but the issue still remains .

    If any one need to make the spinner images untouched as given like the sample image given above by Balaji ,Use Sen's and lepert solution.

    And if you want to make the images beneth the main one and get clicks /selections correctly change the code as given below ..This works for me ..

    Change in

    pointToPosition(int x, int y) in CorousalSpinner.java no need to change the code given by the above solutions

    replace

    Collections.sort(fitting);
    
            if(fitting.size() != 0)
                return fitting.get(0).getIndex();
            else
                return mSelectedPosition;
    

    with

    Collections.sort(fitting);
    
    if(fitting.size() != 0){
        if(fitting.size()>1){
            return fitting.get((fitting.size()-1)).getIndex();
        }else{
            return fitting.get(0).getIndex();   
        }
    
    
    }
    else{
        return mSelectedPosition;
    }
    

提交回复
热议问题