Giter Club home page Giter Club logo

stickheaderlayout's People

Contributors

w446108264 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stickheaderlayout's Issues

ViewPager用在fragment中报IllegalStateException: ViewHolder views must not be attached when created

java.lang.IllegalStateException: ViewHolder views must not be attached when created. Ensure that you are not passing 'true' to the attachToRoot parameter of LayoutInflater.inflate(..., boolean attachToRoot)
at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6796)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)

ViewPager Simple Activity例子

左右滑动当滑动到WebView的时候WebView是自动撑大(有点像向上滑动操作)在往下滑动没有任何反应,在滑动到ListView在回来问题依然存在

使用simpleviewpager时发现一个问题

大神你好,我使用的是ViewPagerSimpleActivity的示例来改的,在placeholderheaderlayout.class中updatePlaceHeight函数中的下面这段代码:
`placeHolderView.post(new Runnable() {
@OverRide
public void run() {
ViewGroup.LayoutParams params = placeHolderView.getLayoutParams();

                if (params != null) {
                    params.height = placeHoderHeight;
                    placeHolderView.setLayoutParams(params);
                }
            }
        });`

发现params有时候会返回null,这样的情况下,导致viewpager中listview是直接显示到了屏幕顶端,也就是headerview设置高度不成功。不知道是我在使用过程中因为修改了别的什么逻辑而导致 出现这样的问题。还是本身就存在 这个问题。于是我将上面这段代码修改为:
`placeHolderView.post(new Runnable() {
@OverRide
public void run() {
ViewGroup.LayoutParams params = placeHolderView.getLayoutParams();

                if(params == null){
                    params = new AbsListView.LayoutParams(
                            AbsListView.LayoutParams.MATCH_PARENT, 
                            AbsListView.LayoutParams.WRAP_CONTENT);
                }

                if (params != null) {
                    params.height = placeHoderHeight;
                    placeHolderView.setLayoutParams(params);
                }
            }
        });`

显示就正常了。

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.