2012-03-16 12 views
0

フォームを持ち、データをリストに表示するMono Androidで書かれたアプリケーションがあります。アプリケーションは正常に動作します。 しかし、今、私はレイアウトに別のフィールドを追加しようとしています:Android.Content.Res.Resources + NotFoundException

<TextView 
      android:id="@+id/textDeliveryNo" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="12345" 
      android:textStyle="bold" 
      android:textColor="@color/title" 
      android:textSize="20px" 

    /> 

私はその値で、このフィールドを設定するacordinglyアクティビティを修正:

//Get our object for this position   
    var item = items[position];       
    var view = (convertView ??     
       context.LayoutInflater.Inflate(     
        Resource.Layout.DeliveriesListItem,        parent,     
        false)) as LinearLayout;    

    //Find references to each subview in the list item's view   
    var imageItem = view.FindViewById(Resource.Id.imageItem) as ImageView; 
    var textDeliveryNo = view.FindViewById(Resource.Id.textDeliveryNo) as TextView; 
    var textDeliveryName = view.FindViewById(Resource.Id.textDeliveryName) as TextView; 
    var textDeliveryAddress = view.FindViewById(Resource.Id.textDeliveryAddress) as TextView; 
    var textDeliveryCityAndZip = view.FindViewById(Resource.Id.textDeliveryCityAndZip) as TextView; 

    //Assign this item's values to the various subviews    
    imageItem.SetImageResource(item.Image); 

ERROR LINE> textDeliveryNo.SetText(item.DeliveryNo, TextView.BufferType.Normal); textDeliveryName.SetText(item.LocationName, TextView.BufferType.Normal); textDeliveryAddress.SetText(item.Address, TextView.BufferType.Normal); textDeliveryCityAndZip.SetText(item.City + ", " + item.PostalCode, TextView.BufferType.Normal);

デバッガがERRORで停止LINEエラー: Android.Content.Res.Resources + NotFoundException:

私はきれいにして、プロジェクトを再構築しようとしました...再起動VS 20 10しかし何も。 私はこの行にコメントするとコンパイルされますが、 "12345"か、android:textプロパティに置いたものが表示されます。

私が得ることができるすべてのお役に立てると思います。 ありがとうございます!

答えて

1

あなたが使用しているSetTextのオーバーロードは、単に文字列(それは数になる)に設定したいときに、リソースIDを必要とします。

使用この代わりに:

txtDeliveryNo.Text = item.DeliveryNo.ToString();

関連する問題