まず、このライブラリを使用して、コンパイルする基本テストプログラムを取得しようとしています:https ://github.com/siyamed/android-satellite-menu
プロジェクトをハードドライブに保存し、Eclipseにインポートしました。また、Java 1.6でコンパイルされ、「islibrary」に設定されていることも確認しました。実際のライブラリは、エラーなしでEclipse内に設定されます。
私のプロジェクトに関しては、GitHubにリストされている手順に従いましたが、XMLファイルから次のエラーが発生します。
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'satelliteDistance' in package 'android.view.ext'
- error: No resource identifier found for attribute 'mainImage' in package 'android.view.ext'
- error: No resource identifier found for attribute 'closeOnClick' in package
'android.view.ext'
- error: No resource identifier found for attribute 'expandDuration' in package
'android.view.ext'
- error: No resource identifier found for attribute 'totalSpacingDegree' in package 'android.view.ext'
XMLファイル全体は次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:sat="http://schemas.android.com/apk/res/android.view.ext"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<android.view.ext.SatelliteMenu
android:id="@+id/menu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|left"
android:layout_margin="8dp"
sat:satelliteDistance="170dp"
sat:mainImage="@drawable/ic_launcher"
sat:totalSpacingDegree="90"
sat:closeOnClick="true"
sat:expandDuration="500"/>
</FrameLayout>
そして私のJavaソースファイル:
package com.example.test_satellite_menu;
import java.util.ArrayList;
import java.util.List;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.ext.SatelliteMenu;
import android.view.ext.SatelliteMenuItem;
public class MainActivity extends Activity {
SatelliteMenu menu = (SatelliteMenu) findViewById(R.id.menu);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<SatelliteMenuItem> items = new ArrayList<SatelliteMenuItem>();
items.add(new SatelliteMenuItem(4, R.drawable.ic_launcher));
items.add(new SatelliteMenuItem(4, R.drawable.ic_launcher));
items.add(new SatelliteMenuItem(4, R.drawable.ic_launcher));
items.add(new SatelliteMenuItem(3, R.drawable.ic_launcher));
items.add(new SatelliteMenuItem(2, R.drawable.ic_launcher));
items.add(new SatelliteMenuItem(1, R.drawable.ic_launcher));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
テストプロジェクトにサテライトメニューライブラリが含まれていることを確認し、「プロジェクトのプロパティを修正する」と「プロジェクトをクリーンにする」を使用したので、今はアイデアがありません:)取得に関するフィードバックこれが機能するのは素晴らしいことです。ありがとう!
StackOverflowをもう少し読んだ後、私自身の答えを見つけました。android.view.awtパッケージ名を現在のプロジェクトのパッケージ名に変更する必要がありました。