ビットマップの一部をクリック可能にしたいのですが、レイアウトは次のようになります。
________________________________
| ##### |
| ##### |
| ___________________ |
| | | |
| | | |
| | image | |
| | | |
| | | |
| ___________________ |
________________________________
これを行う最も簡単な方法は、相対的なレイアウトで画像の上にボタンを配置することだと思いました。
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/ImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</ImageView>
<Button
android:id="@+id/Button"
android:layout_width="200dip"
android:layout_height="150dip"/>
</RelativeLayout>
しかし、ボタンを画像の左上隅に揃える方法がわかりません(現在のように相対的なレイアウトの左上隅ではなく)。これは相対レイアウトで可能ですか?
http://blahti.wordpress.com/2012/06/26/images-with-clickable-areas/ しかし、私の単純な長方形の領域には少しやり過ぎのようです。