0

私はそれを失うところにいます。

問題: GraphInWebViewを formDialog (他のファイル) というレイアウト に膨らませます。formDialog.AddView(LayoutInflater.Inflate(Resource.Layout.GraphInWebview, null));

これだけでも完璧に機能しますが、LineItemGraphInWebView@+id/SideWidgetに膨らませようとすると、後者は表示されません。

ソースを確認しました - LineItemビューは膨張していますが、SideWidget にネストされていません

次のxmlファイルがあります。

GraphInWebview.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
  <WebView
      android:id="@+id/graphView"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="#00FF00"/>
  <LinearLayout
        android:id="@+id/SideWidget"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#0000FF">
  </LinearLayout>
</LinearLayout>

lineItem.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
       android:orientation="vertical"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent">
  <RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content">
    <ImageView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:src="@drawable/Icon"
      android:maxHeight="5dp"
      android:maxWidth="5dp"
      android:id="@+id/icon"
      android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"/>
    <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Appointment: Appointment with Spur Cresta"
      android:id="@+id/appointmentTitle"
      android:minWidth="60dp"
      android:layout_alignParentBottom="true"
      android:layout_toRightOf="@+id/icon"/>
  </RelativeLayout>
  <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Appointment: Appointment with Spur Cresta"
    android:id="@+id/appointmentText"
    android:minWidth="60dp"/>
</LinearLayout>

C#

        //First inflate views to be injected into the default action bar
        formDialog.AddView(LayoutInflater.Inflate(Resource.Layout.googleGraphInWebview, null));

        manageScheduleButton = (Button)FindViewById(Resource.Id.ManageButton);
        locationalServicesButton = (Button)FindViewById(Resource.Id.LocationalServicesButton);
        myProfileButton = (Button)FindViewById(Resource.Id.MyProfileButton);
        myClientsButton = (Button)FindViewById(Resource.Id.MyClientsButton);

        manageScheduleButton.Click += ManageScheduleMenuClick;
        locationalServicesButton.Click += locationalServicesButtonClick;
        myProfileButton.Click += myProfileButtonClick;
        myClientsButton.Click += myClientsButtonClick;

        formDialog.SetMinimumHeight(400);

        WebView graph = FindViewById<WebView>(Resource.Id.graphView);
        LinearLayout sideWidget = FindViewById<LinearLayout>(Resource.Id.SideWidget);
        sideWidget.AddView(LayoutInflater.Inflate(Resource.Layout.LineItem, null));

        graph.Settings.JavaScriptEnabled = true;
        graph.SetWebViewClient(new webView(formDialog));
        graph.LoadUrl("file:///android_asset/graph.html");

誰でもこの問題を解決する方法をアドバイスできますか?

よろしく

4

1 に答える 1