2017-03-21 6 views
0

自分のアプリケーションでSearchViewを使用しようとしています。私はandroid.support.v7.widget.SearchViewを使用することに決めましたが、デザイナーでレイアウトをレンダリングするときにxamarinスタジオにエラーがあります。Xamarin Android:xamlのandroid.support.v7.widget.SearchViewの追加方法

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@color/lightGray"> 
<TextView 
    android:id="@+id/weatherLocation" 
    android:textStyle="bold" 
    android:textColor="@color/material_grey_600" 
    style="@android:style/TextAppearance.Large" 
    android:layout_marginTop="@dimen/abc_action_bar_subtitle_bottom_margin_material" 
    android:layout_marginBottom="@dimen/abc_action_bar_subtitle_bottom_margin_material" 
    android:layout_marginLeft="@dimen/abc_action_bar_subtitle_bottom_margin_material" 
    android:layout_alignParentTop="true" 
    android:layout_alignParentStart="true" 
    android:text="" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
<android.support.v7.widget.SearchView 
    style="@style/SearchViewStyle" 
    android:id="@+id/search" 
    android:layout_width="300dp" 
    android:layout_height="wrap_content" 
    android:layout_alignTop="@+id/weatherLocation" 
    android:layout_alignEnd="@+id/weatherLocation" 
    android:layout_alignBottom="@+id/weatherLocation" 
    android:layout_alignParentEnd="true" /> 

メッセージ:カスタムコントロールが無効です。レンダリングプロセスには内部的な問題がありました。

私はパッケージをインストールしていないということですか?私はザマリンスタジオのナゲットでそれを見ることができません。

P.S.私はコンパイルして実行することができますが、エラーが膨らんでしまいます。

答えて

1

インストールしたパッケージは「インストール済み」タブにあります。見つけられない場合は、パッケージをインストールしていないことを意味します。 NuGetにインストールし、 'Xamarin.Android.Support.v7.SearchView'を検索してダウンロードしてください。

+0

私はまだバイナリXMLファイル行#1を取得しています:クラスを膨張させるエラー。android.support.v7.widget.SearchView – LittleFunny

+0

エラーメッセージが変更されていますので、主な問題は修正されています。 obj/binフォルダを削除してから、プロジェクトをきれいにして再構築できますか?それがこの問題を解決できるかどうかを確認してください。 –

+0

これは、アクティビティを@ style/Theme.AppCompat.LightでAppCompatActivityに変更すると機能しますが、上のActionBarが好きではありません。私がActionBar.Hideを呼び出す前に、テーマを – LittleFunny

関連する問題