iam 使用 Aphid-FlipView-Library 使用 webview 显示静态 html 页面。
但是在翻转时,(移动)从一页到另一页我得到一些白框,在第二页正常加载之后..
任何人都可以帮助我,如何删除那个闪光外观..
public class FlipTextViewFragment extends Fragment {
private FlipViewController flipView;
String[] urls = {"file:///android_asset/Introduction_print.html","file:///android_asset/introduction2.html"};
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
flipView = new FlipViewController(inflater.getContext(), FlipViewController.HORIZONTAL);
flipView.setAdapter(new adp(getActivity().getApplicationContext()));
return flipView;
}
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
}
public void setText(String item) {
flipView.setAdapter(new adp(getActivity().getApplicationContext()));
}}
那么我的适配器类就在这里:package com.example.flipwebview;
public class adp extends BaseAdapter {
String[] urls = {"file:///android_asset/Introduction_print.html","file///android_asset/introduction2.html"};
Context con;
public adp(Context applicationContext) {
// TODO Auto-generated constructor stub
con=applicationContext;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return urls.length;
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
WebView wv=new WebView(con);
wv.loadUrl(urls[position]);
return wv;
}}
通过使用我的代码,我可以翻阅多个 webviews,但我遇到的问题是,当我在翻页的中途看不到下一个视图时,它似乎是一个空白页,在我完全翻页后它被加载..这是关于那个的屏幕