Rox Posted January 7, 2011 Share Posted January 7, 2011 Bonjour tout le monde, Je souhaiterais faire le même genre de truc que les images maps en html, c'est à dire afficher une image et ensuite que l'utilisateur puisse cliquer sur certaine partie de l'image. J'ai retourné toute la doc, je n'ai rien trouvé... Merci de m'avoir lu ! Link to comment Share on other sites More sharing options...
Rox Posted January 15, 2011 Author Share Posted January 15, 2011 Bon, j'ai pas trouvé pour les imagemap, mais j'ai contourné le problème. J'ai fait un tableview avec l'image en background, et chaque cellule est clickable. voili voilu, si ça peux servir à quelqu'un :) <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tblJobs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/muscleselect" android:shrinkColumns="*"> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" > <View android:id="@+id/z1" android:layout_width="160dp" android:layout_height="140dp" android:onClick="popMe"/> <View android:id="@+id/z2" android:layout_width="317dp" android:layout_height="140dp" android:onClick="popMe/> </TableRow> </TableLayout> et dans le java package org.me.testapp; import android.app.Activity; import android.widget.Toast; import android.os.Bundle; import android.view.View ; public class testApp extends Activity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.tabletest); } public void popMe (View view) { Toast toast = Toast.makeText(this.getApplicationContext(), "ID : "+view.getId(), Toast.LENGTH_LONG); toast.show(); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.