Coder Social home page Coder Social logo

Comments (2)

Fessible avatar Fessible commented on July 2, 2024

你不能复用 iv3和iv0,每个view要单独创建一个
也就是
ImageView iv02 = new ImageView(getActivity().getApplicationContext());
iv02.setImageBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.image0));
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));
ImageView iv32 = new ImageView(getActivity().getApplicationContext());
iv32.setImageBitmap(BitmapFactory.decodeResource(getResources(),R.drawable.image3));
views.add(iv32);
views.add(iv0);
views.add(iv1);
views.add(iv2);
views.add(iv3);
views.add(iv02);

from cycleviewpager.

androiddevelop avatar androiddevelop commented on July 2, 2024

一个view只能有一个parent,所以复用的前提是两个view不能挨着,挨着的话切换的时候会有问题

from cycleviewpager.

Related Issues (6)

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.