w446108264 / stickheaderlayout Goto Github PK
View Code? Open in Web Editor NEWAn Android library supports sticking the navigator on the top when ItemView scrolls.
License: Apache License 2.0
An Android library supports sticking the navigator on the top when ItemView scrolls.
License: Apache License 2.0
大神你好,我使用的是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);
}
}
});`
显示就正常了。
左右滑动当滑动到WebView的时候WebView是自动撑大(有点像向上滑动操作)在往下滑动没有任何反应,在滑动到ListView在回来问题依然存在
求解救啊
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.