droidQueryライブラリを使用して、ジェスチャー検出をアプリに追加しています。SwipeInterceptorView を xml ファイルに追加する際に問題が発生しました (元の質問hereを参照してください。メソッド内で定義しonCreate
、同じパラメーターを指定します。次に、を使用してレイアウトに追加します。レイアウト ファイルlayout.addView(swipeInterceptorView)
に追加しようとしましたが、XML
しかし、私はエラーが発生しました。
プログラム的に優れたプラクティスを定義していますかSwipeInterceptorView
、それともファイルに追加する必要がありXML
ますか? XML
必要な場合、このファイルを修正するにはどうすればよいですか? :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/table"
android:orientation="vertical" >
<self.philbrown.SwipeInterceptorView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_view"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</self.philbrown.SwipeInterceptorView>
<FrameLayout
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
このレイアウトを使用すると、ランタイム エラーが発生 java.lang.ClassNotFoundException
します。
また、 を に追加する方法は知ってonClickListener
いImageView
ますが、リスナーを に追加する方法を誰か教えてもらえますTextView
か?
助けてくれてありがとう!