2011-08-08 5 views
0

私は8つの画像のセットを持っています。ボタンをクリックすると、次の画像が表示されます。Androidプラットフォーム:スクロール可能なズーム可能な画像を表示するには

私はImageViewの中で私のイメージをロードすることができています。 1.私はそのイメージがscrobbable &ズーム可能であるので、プログラムの変更を行うためにどのよう 2.をクリックし、ボタンの上に画像を変更する方法を見つけることができません。

enter code here 
<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1"> 
    <ImageView 
    android:id="@+id/imageview1" 
    android:gravity="center_horizontal" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1" 
    android:src="@drawable/img1"  
    android:adjustViewBounds="true" 
    android:keepScreenOn="true" 
    android:scrollbarStyle="outsideOverlay" 
    android:scrollbars="horizontal" android:scaleType="fitXY"/> 
    <Button  
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:id="@+id/button1" 
    android:text="Next"/> 
</LinearLayout> 

答えて

0

ズームImageViewについては、this投稿を参照してください。ボタンをクリックしたときに画像を変更する方法については、hereからボタンクリックリスナーを追加する方法をお読みになることをお勧めします。 Googleの "アンドロイドボタンonclickの例"と多くの例があります。ボタンをクリックして画像を変更する方法がまだわからない場合は、Android Developers Guideをチェックしてください。イベントやUIなどの便利な情報がたくさんあります。

hereもあります。

あなたのボタンのコールの onClickLister
2

  1. YourImageView.setImageBitmap(YourBitmap);

  2. thisリンクをご覧ください。 Android上のマルチタッチジェスチャーに関する基本的なチュートリアルですが、画像を移動してピンチズームする方法の例もあります。

関連する問題