黑马程序员技术交流社区
标题:
帮我看个东西 WebView 里面的对话框点过去获取不到输入事件
[打印本页]
作者:
Treasureと情
时间:
2012-9-19 20:26
标题:
帮我看个东西 WebView 里面的对话框点过去获取不到输入事件
帮我看个东西 WebView 里面的对话框点过去获取不到输入事件 跳到其他地方再跳回来就有了 怎么解决
布局(UI)
<?xml version="1.0" encoding="utf-8"?>
<!-- VIP服务宝典 -->
<LinearLayout xmlns:android="
http://schemas.android.com/apk/res/android
"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- 标题栏 -->
<FrameLayout
android:layout_width="fill_parent"
android:background="@drawable/title_bar"
android:layout_height="wrap_content" >
<TextView
style="@style/titleText"
android:id="@+id/honourlifeottf_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|top"
android:gravity="center"
android:text="列车查询" />
</FrameLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<WebView
android:id="@+id/honourlifeone_webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
</LinearLayout>
前面的类
HonourLifeOneView honourLifeOneView6 = new HonourLifeOneView(HonourLifeActivity.this);
// 有缓存
if (viewCache.get(index) != null
&& viewCache.get(index).get() != null) {
view = viewCache.get(index).get();
} else {
view = honourLifeOneView6.getView();
viewCache.put(index, new SoftReference<View>(
view));
}
当前类
public class HonourLifeOneView {
private HonourLifeActivity honourLifeActivity;
private LayoutInflater inflater;
private View view;
private WebView honourlifeone_webview;
private TextView text;
public HonourLifeOneView(HonourLifeActivity honourLifeActivity) {
this.honourLifeActivity = honourLifeActivity;
inflater = LayoutInflater.from(honourLifeActivity);
}
public View getView() {
view = inflater.inflate(R.layout.honourlifeone, null);
honourlifeone_webview=(WebView) view.findViewById(R.id.honourlifeone_webview);
text=(TextView) view.findViewById(R.id.honourlifeottf_text);
text.setText("列车查询");
honourlifeone_webview.loadUrl("
http://211.138.250.232:1088/wxcs/train/wapquery.do?method=show&ua=Mozilla&token=&userid=&pt=wap&mobile=&area=nanning&version=3&rescode=SSB00154026201111282128320539&columnid=4117
");
return view;
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2