私はAndroid開発にかなり慣れていません-WPFのバックグラウンドから来ています。
Eclipseの「ワークスペース」に2つのAndroidプロジェクトを作成しました。1つは「TestProject」と呼ばれ、もう1つは「TestLibraryProject」と呼ばれます。
「TestLibraryProject」内に、BlueBoxというカスタムビューを作成しました。
「TestProject」のメインレイアウトでBlueBoxを使用したいと思います。どういうわけか「TestProject」から「TestLibraryProject」を参照する必要があることを知って、「TestProject」を右クリックしてメニューに従いました。
ビルドパス->ライブラリの追加
ポップアップ表示されたダイアログで「AndroidClasspathContainer」を選択し、その直後のダイアログでコンボボックスから「TestLibraryProject」を選択しました。
2つの質問:1。これは、「TestLibraryProject」を「TestProject」に含めて使用できるようにする正しい方法ですか?2.メインレイアウトXMLでBlueBoxを使用するにはどうすればよいですか?
これをXMLファイルに入れてみました。
<mypackage.TestLibraryProject.BlueBox
android:id="@+id/my_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
しかし、それはうまくいきませんでした。また、ルートレイアウト要素で名前空間を参照してみました。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:binding="http://www.gueei.com/android-binding/"
xmlns:testlibrary="http://schemas.android.com/apk/res/android/mypackage2.TestLibraryProject"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
しかし、それは役に立たなかったようです。
助言がありますか?アイデア?ヘルプ?
ありがとう!