R作者treeyoyo (討厭KFC)
看板AndroidDev
標題[問題] Imageview轉貼的問題
時間Sat Feb 23 14:11:46 2013
我現在做了一個gallery在上面的配置
以下是畫面
圖一 圖二 圖三 (這塊往左往右滑動)
---------
這塊秀上面圖一~圖三的大圖
---------
我現在想將下面大圖做成按下去
轉到另一格畫面(我另一個畫面想
用canvas弄成一個像小畫家畫畫板這樣)
我該用什麼方式轉過去
下面顯示是imageView 可以做成button嗎?
利用Intent的方式可行嗎? 抱歉問題有點多~每天都被老師追殺很無助
以下是程式碼
layout 配置
<?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"
>
<Gallery
android:id="@+id/gallery"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:spacing="10dp"
/>
<ImageView
android:id="@+id/imageview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
----------------------------------------------------------------------------
控制的程式碼
http://pastebin.com/vxDQsYTk
抱歉版面有點亂~請求大大幫忙了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.124.77.3
※ 編輯: treeyoyo 來自: 140.124.77.3 (02/23 14:14)
1F:→ sweet00914:setOnClickListener?0.0? 02/23 16:45
2F:推 motors55:ImageButton 02/24 08:49
用 VIEW.OnClickListener 這不知道行不行
※ 編輯: treeyoyo 來自: 140.124.77.3 (02/24 13:01)
3F:推 dementia:基本上,ImageView和Button都屬於View,應該都可以用OnClic 03/03 08:35
4F:→ dementia:kListener,也都可以設src和background,你試試看吧 03/03 08:36
5F:推 dementia:Intent可以,可是你可能還需要SharedPreferences 03/03 08:42