android– 如何正确扩展WebView?

android– 如何正确扩展WebView?,第1张

概述我正在使用ScrollwebviewhorizontallyinsideaViewPager的解决方案它看起来非常有用,我在xml中引用了ExtendedWebView,<ExtendedWebViewandroid:id="@+id/webview"android:layout_width="fill_parent"android:layout_height="fill_parent"/&g

我正在使用Scroll webview horizontally inside a ViewPager的解决方案

它看起来非常有用,我在xml中引用了ExtendeDWebVIEw,

<ExtendeDWebVIEw    androID:ID="@+ID/webvIEw"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"/>

.class中的实例ExtendeDWebVIEw,

LayoutInflater mInflater =  (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);layout  = mInflater.inflate(R.layout.lay1, null);ExtendeDWebVIEw webVIEw = (ExtendeDWebVIEw)layout.findVIEwByID(R.ID.webvIEw);

但我得到’错误膨胀类ExtendeDWebVIEw’,所以任何人都可以帮助我给我一些想法,感谢您的时间和经验!

继承人是整个堆栈跟踪,

12-27 22:14:44.263: E/AndroIDRuntime(10824): FATAL EXCEPTION: main12-27 22:14:44.263: E/AndroIDRuntime(10824): androID.vIEw.InflateException: Binary XML file line #7: Error inflating class com.vv_package_name.ExtendeDWebVIEw12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:576)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.rInflate(LayoutInflater.java:618)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:407)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:320)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.inflate(LayoutInflater.java:276)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at com.vv_package_name.vv_main$ExtendedPagerAdapter.instantiateItem(vv_main.java:135)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.support.v4.vIEw.PagerAdapter.instantiateItem(PagerAdapter.java:110)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.support.v4.vIEw.VIEwPager.addNewItem(VIEwPager.java:801)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.support.v4.vIEw.VIEwPager.populate(VIEwPager.java:930)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.support.v4.vIEw.VIEwPager.populate(VIEwPager.java:881)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.support.v4.vIEw.VIEwPager.onMeasure(VIEwPager.java:1366)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEw.measure(VIEw.java:8226)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.Widget.linearLayout.measureVertical(linearLayout.java:526)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.Widget.linearLayout.onMeasure(linearLayout.java:304)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEw.measure(VIEw.java:8226)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEwGroup.measureChilDWithmargins(VIEwGroup.java:3132)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.Widget.FrameLayout.onMeasure(FrameLayout.java:245)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEw.measure(VIEw.java:8226)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.Widget.linearLayout.measureVertical(linearLayout.java:526)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.Widget.linearLayout.onMeasure(linearLayout.java:304)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEw.measure(VIEw.java:8226)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEwGroup.measureChilDWithmargins(VIEwGroup.java:3132)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.Widget.FrameLayout.onMeasure(FrameLayout.java:245)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEw.measure(VIEw.java:8226)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEwRoot.performTraversals(VIEwRoot.java:801)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.VIEwRoot.handleMessage(VIEwRoot.java:1727)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.os.Handler.dispatchMessage(Handler.java:99)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.os.Looper.loop(Looper.java:123)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.app.ActivityThread.main(ActivityThread.java:4627)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at java.lang.reflect.Method.invokeNative(Native Method)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at java.lang.reflect.Method.invoke(Method.java:521)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:616)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at dalvik.system.NativeStart.main(Native Method)12-27 22:14:44.263: E/AndroIDRuntime(10824): Caused by: java.lang.classNotFoundException: com.vv_package_name.ExtendeDWebVIEw in loader dalvik.system.PathClassLoader[/data/app/com.vv_package_name-2.apk]12-27 22:14:44.263: E/AndroIDRuntime(10824):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at java.lang.classLoader.loadClass(ClassLoader.java:573)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at java.lang.classLoader.loadClass(ClassLoader.java:532)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.createVIEw(LayoutInflater.java:466)12-27 22:14:44.263: E/AndroIDRuntime(10824):    at androID.vIEw.LayoutInflater.createVIEwFromTag(LayoutInflater.java:565)12-27 22:14:44.263: E/AndroIDRuntime(10824):    ... 33 more

如果使用WebVIEw而不是ExtendeDWebVIEw,我的代码工作正常:)

解决方法:

您需要提供该类的完整参考,包括包.

例如,

<org.example.myapp.ExtendeDWebVIEw    androID:ID="@+ID/webvIEw"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent" />
总结

以上是内存溢出为你收集整理的android – 如何正确扩展WebView?全部内容,希望文章能够帮你解决android – 如何正确扩展WebView?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1113023.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存