【发布时间】:2010-09-06 23:44:08
【问题描述】:
我正在为我的公司开发一个应用程序。其中一个按钮加载谷歌日历的网络视图。这工作得很好,我所有的其他 webviews 都可以适当地滚动。但是,当加载此日历时,它会根据屏幕大小调整大小并且不会滚动。我尝试将 webview 设置为线性布局并使 webview 的高度为 4096px。这会将日历扩展到屏幕底部之外,但它不会滚动。边走边学android,小时候有一些编程经验,全是命令行。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="4096px">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="1020px"></WebView>
</LinearLayout>
代码是
WebView calendar = (WebView) findViewById(R.id.webview);
calendar.setBackgroundColor(0);
calendar.setScrollBarStyle(3);
calendar.getSettings().setJavaScriptEnabled(true);
Toast.makeText(getApplicationContext(), "Loading Events Calendar", Toast.LENGTH_SHORT).show();
calendar.loadUrl("http://www.google.com/calendar/embed?src=blahblah%40blah.com&mode=Agenda");
为 webview 启用了 Javascript。任何帮助将不胜感激。
【问题讨论】:
标签: android calendar scroll webview