2017-05-10 40 views
-1

私は自分のアプリにメニューを追加しようとしていますが、何か問題がありました。私はかなりxamarinアンドロイドに私はほとんどコピー/インターネットからのものを貼り付けに新しいです。私のAxmlファイルの変更は、私のResource.Designer.csファイルを変更する作業を停止しました。 FindViewById <>メソッドでは、それらの要素のどれも見つけることができません。これは私のAXMLです:グローバル属性...既に宣言されています

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:minWidth="25px" 
    android:minHeight="25px"> 
    <android.support.v7.widget.DrawerLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:id="@+id/drawer_layout" 
     android:fitsSystemWindows="true"> 
     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 
      <android.support.v7.widget.Toolbar 
       android:id="@+id/toolbar" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:minHeight="?attr/actionBarSize" 
       android:background="?attr/colorPrimary" 
       android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
       app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> 
     </RelativeLayout> 
     <android.support.design.widget.NavigationView 
      android:layout_width="wrap_content" 
      android:layout_height="match_parent" 
      android:layout_gravity="start" 
      android:id="@+id/nav_view" 
      app:menu="@MenuLayout" 
      app:headerLayout="@Header" /> 
     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/textView1" 
      android:layout_marginBottom="31.0dp" 
      android:textSize="32dp" 
      android:textStyle="bold" 
      android:typeface="sans" 
      android:gravity="center" /> 
     <TableLayout 
      android:orientation="vertical" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/buttonLayout" 
      android:weightSum="2" /> 
     <ListView 
      android:minWidth="25px" 
      android:minHeight="25px" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:id="@+id/ListView" /> 
    </android.support.v7.widget.DrawerLayout> 
</LinearLayout> 

、私はまた、いくつかのものを実装し、ダウンロードするために必要な、インターネットからのもののほとんどをコピーしたことから。私はこれをして以来、私のプログラムには "警告"があります。私はこれらの警告が私のResource.Designer.csがもう更新されない理由だと思います。ここに私が見ている警告のいくつかがあります:

Severity Code Description Project File Line Suppression State 
Warning  The global attribute 'http://schemas.android.com/apk/res/android:accessibilityLiveRegion' has already been declared. CardAppReal C:\Users\bfonta01\documents\visual studio 2015\Projects\CardAppReal\CardAppReal\Resources\layout\Main.axml 7 


Severity Code Description Project File Line Suppression State 
Warning  The global attribute 'http://schemas.android.com/apk/res/android:accessibilityTraversalAfter' has already been declared. CardAppReal C:\Users\bfonta01\documents\visual studio 2015\Projects\CardAppReal\CardAppReal\Resources\layout\Main.axml 35 

Severity Code Description Project File Line Suppression State 
Warning  The global attribute 'http://schemas.android.com/apk/res/android:accessibilityTraversalBefore' has already been declared. CardAppReal C:\Users\bfonta01\documents\visual studio 2015\Projects\CardAppReal\CardAppReal\Resources\layout\Main.axml 55 

もし何かもっと必要な場合は質問してください。

助けてくれてありがとう!

ビョルン

答えて

1

これは、このような警告と私自身の経験から外れている、注意してください。これらの警告は、Androidサポートライブラリからのビューを使用しているときに表示されるようです。 Android Studioにはこれらの問題はありませんが、Visual StudioでXamarinを使用していると、同僚から聞いたことがあります。私はいつも、警告が来ている.axmlファイルを閉じてからプロジェクトをビルドして展開するだけで、これを修正できます。

展開を試みてビルドが数回失敗する場合は、数秒待ってからもう一度展開してみると、いくつか試行しても機能します。

+0

この後、新しい問題が発生します。 重大\tコード\t説明\tプロジェクト\tファイル\tライン\t抑制状態 属性「パッケージ」のスキーマ情報を見つけることができませんでしたメッセージ\t \t。 重大\tコード\t説明\tプロジェクト\tファイル\tライン\t抑制状態「http://schemas.android.com/apk/res/android:icon」属性が宣言されていない\t \t 警告。 私のResource.Designer.csファイルもまだ更新されません –

+0

@BjornFontaineこの警告はどのファイルから来ますか?また、Resource.Designer.csはコンパイル時に構築されていますが、削除して解決したかどうかを確認するためにソリューションを再構築しましたか? – Raimo

関連する問題