2016-12-21 7 views
1

存在し、私がインストールされていませんxamarin.android.support.v4およびその他の必要が、それは私が試してみましたエラー:パッケージアンドロイド:。support.v4 ####私は自分のアプリケーションにフラグメントを追加したい

error: package android:support.v4.view or app or content etc. does not exist.

エラーになります空白のプロジェクトで同じ結果を返します。

私はAndroid 7.0と最新のサポートライブラリを使用しています。

+0

android.app.Fragment'では、サポートライブラリは不要です –

+0

サポートライブラリの他の機能はどうですか? –

+0

Fragmentsを追加したいと言ったばかりです: –

答えて

0

For now,i want to also add RecyclerView and CardView

これらの2つのコントロールを使用するには、プロジェクトにXamarin.Android.Support.v7.RecyclerViewパッケージとXamarin.Android.Support.v7.CardViewをインストールする必要があります。 Nugetを使用してXamarin.Android.Support.v7.RecyclerViewパッケージをインストールすると、Xamarin.Android.Support.v4パッケージが自動的にインストールされます。

そして、あなたはこのようなRecyclerView使用することができます。

<android.support.v7.widget.RecyclerView 
    android:id="@+id/recyclerView" 
    android:scrollbars="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" /> 

をそしてそうCardViewは次のとおりです。

<android.support.v7.widget.CardView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    card_view:cardElevation="4dp" 
    card_view:cardUseCompatPadding="true" 
    card_view:cardCornerRadius="5dp"> 
    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:padding="8dp"> 
     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:id="@+id/imageView" 
      android:scaleType="centerCrop" /> 
     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="#333333" 
      android:text="Caption" 
      android:id="@+id/textView" 
      android:layout_gravity="center_horizontal" 
      android:layout_marginLeft="4dp" /> 
    </LinearLayout> 
</android.support.v7.widget.CardView> 

あなたはXamarinでRecyclerViewを使用してカスタマイズするためのXamarinの公式文書RecyclerViewを参照することができます。 Androidアプリケーション

まだ問題がある場合は、最小限の再生可能なデモを提供してください。この問題を引き続き調査できますか?

+0

私はXamarinを更新しました。問題が修正されたようです。もう一度起きたら、私はあなたに通知します! –

関連する問題