Coder Social home page Coder Social logo

cycleviewpager's Issues

图片滑动效果不连贯

布局上添加图片以后,当滑动到临界位置进行切换时,会有小小的跳动动画。
无限循环时效果不是非常完美。

不完美处在这里

@OverRide
public void onPageSelected(int position) {
curPosition = position;

    if (curPosition == list.size() - 1 || curPosition == 0) {
        final int newReplacePosition = getRealPosition(curPosition);
   
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                viewPager.setCurrentItem(newReplacePosition,false);
            }
        },250);
    }
}

导入报错

在android studio中加上
compile 'me.codeboy.android:cycle-view-pager:2.0.0'
然后报错:
Error:Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute application@label value=(@string/app_name) from AndroidManifest.xml:8:9-41
is also present at [me.codeboy.android:cycle-view-pager:2.0.0] AndroidManifest.xml:13:9-58 value=(@string/cycle_view_pager_app_name).
Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:5:5-19:19 to override.

用fragement里显示。共四张图循环,每次最后一张图是空白,请问咋处理呀?

List views = new ArrayList();
ImageView iv0 = new ImageView(getActivity().getApplicationContext());
iv0.setImageBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.image0));
ImageView iv1 = new ImageView(getActivity().getApplicationContext());
iv1.setImageBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.image1));
ImageView iv2 = new ImageView(getActivity().getApplicationContext());
iv2.setImageBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.image2));
ImageView iv3 = new ImageView(getActivity().getApplicationContext());
iv3.setImageBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.image3));

    views.add(iv3);
    views.add(iv0);
    views.add(iv1);
    views.add(iv2);
    views.add(iv3);
    views.add(iv0);
    CycleViewPager cycleViewPager =fragmentTuijianBinding.cycleViewPager;
     //循环+轮播,3000ms自动切换
    cycleViewPager.setData(views, true, true, 3000);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.