Comments (7)
支持
from viewpagerindicator.
请问如何实现呢?我发现网页会有闪烁效果。
from viewpagerindicator.
private class MainPageAdapter extends IndicatorViewPager.IndicatorViewPagerAdapter {
@Override
public int getCount() {
return 10;
}
@Override
public View getViewForTab(int position, View convertView, ViewGroup container) {
if (convertView == null) {
convertView = LayoutInflater.from(container.getContext()).inflate(R.layout.tab_top, container, false);
}
TextView textView = (TextView) convertView;
textView.setText("tab" + position);
return convertView;
}
@Override
public View getViewForPage(int position, View convertView, ViewGroup container) {
if (convertView == null) {
convertView = createWebView(container);
}
WebView webView = (WebView) convertView;
webView.loadUrl("https//:www.baidu.com");
return convertView;
}
private WebView createWebView(ViewGroup container) {
WebView webView = new WebView(container.getContext());
webView.getSettings().setJavaScriptEnabled(true);
return webView;
}
}
from viewpagerindicator.
你可以设置 viewPager.setOffscreenPageLimit(2);
保持左右两边有2个缓存页面
from viewpagerindicator.
你好,该方法我已经做了。但是getViewForPage会重复调用,导致,及时你在网页进入了其他选项,还是会回到百度首页。
from viewpagerindicator.
你不重复利用的话,难道所有的都要重新创建 并且保留在内存中?
from viewpagerindicator.
我看了每次convertView地址都不一样。所以导致网页根本每次都会重新加载。这样的话,用网页或者其他的任何东西就没用了。
from viewpagerindicator.
Related Issues (20)
- 单个banner图仍是无限循环(手势滑动) HOT 1
- 不能结合ScrollView使用 HOT 3
- Banner 轮播图片点击事件怎么做?
- 这个和折叠布局不能一起使用? HOT 2
- 选中的Tab会导致右边的Tab 也加粗了0.3
- 最新版的jar包在哪可以下载? HOT 1
- 如何设置同一个tab的点击事件重复点击只响应一次呢?
- 不设置setScrollBar,修改文字的大小和颜色就会无效
- 指示器的下划线怎么设置和文字的距离?不让下划线默认在指示器的最底部
- FixedIndicatorView的scroller有bug,导致View不停重绘。
- tab 文字长度发生改变,如何改变scrollBar的长度
- recyclerIndicatorView不能设置GridLayoutManager?
- indicatorViewPager.setPageCanScroll
- ScrollIndicatorView配合ViewPager的时候,页面中使用了Listview或RecycleView,无法左右滑动切换页面,怎么解决的?
- bannerIndicator如何设置成圆点
- 不支持kotlin
- Jcenter官方不在接收新的更新
- 哥,还维护么? HOT 1
- Openharmony application
- 是否可以实现 es 文件管理器那种 tab?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from viewpagerindicator.