XML レイアウト (activity_trajectory.xml) で使用しているカスタム ビュー (CoordinateGridView) があります。
<com.android.catvehicle.CoordinateGridView
android:id="@+id/coordinateGrid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
グラフィカル エディターで次のエラーが表示されます: **.CoordinateGridView をインスタンス化できませんでした。
これは、カスタム ビューのコンストラクタです。
public CoordinateGridView(Context context, AttributeSet attrs) {
super(context, attrs);
setFocusable(true);
setFocusableInTouchMode(true);
this.setOnTouchListener(this);
hostActivity = (TrajectoryActivity) this.getContext();
}
これは、CoordinateGridView を含むレイアウトを設定しているアクティビティです。
public class TrajectoryActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
removeActionBar();
setContentView(R.layout.activity_trajectory);
initializeViews();
loadSettings();
}
}
ここの問題についてのアイデアはありますか?カスタム ビューがレイアウト内の他のすべてのビューをブロックしているため、グラフィカル エディターで何も表示されないのはイライラします...