A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

帮我看个东西  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;
}

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马