Jump to content

scrollview horizontal et vertical


buzeeg

Recommended Posts

Bonjour,

Je souhaite afficher au sein de mon application un simple tableau d'ImageView. Mon problème est que mon tableau ne peux pas rentrer dans l'écran et donc je souhaite permettre le scroll dans les deux sens : horinzontal et vertical.

Aujourd'hui, le seul moyen simple que j'ai trouvé est de combiner deux scroll view :

<HorizontalScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
<ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
	<LinearLayout
		android:layout_height="wrap_content"
		android:layout_width="match_parent"
		android:orientation="vertical"
		android:isScrollContainer="true">
		<LinearLayout
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:orientation="horizontal"
			android:isScrollContainer="true">
			<ImageView android:id="@+id/img1" android:layout_height="wrap_content" android:layout_width="wrap_content"
				android:src="@drawable/bot1"></ImageView>
			<ImageView android:id="@+id/img2" android:layout_height="wrap_content" android:layout_width="wrap_content"
				android:src="@drawable/bot2"></ImageView>

			<...>

		</LinearLayout>

		<...>

	</LinearLayout>
</ScrollView>
</HorizontalScrollView>

Le seul problème est que le scroll n'est pas vraiment utilisable : il n'y en a qu'un à la fois qui se déclenche (par ex horizontal en premier), et l'autre reste bloqué. Il faut relaché le doigt et scroller à nouveau.

Bref ça me plait pas et j'aimerais savoir si quelqu'un à déjà eu ce problème ou a tout simplement une solution (qui ne nécessite pas de re-coder la ScrollView comme je l'ai vu dans mes recherche google : exemple) :)

Merci d'avance!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...