1
我創建我的應用程序一個UIScrollView - 改編自此示例代碼:http://developer.apple.com/iphone/library/samplecode/Scrolling/Introduction/Intro.html的UIScrollView可點擊圖片iPhone
但我不知道如何使圖像點擊
任何建議嗎?
謝謝!
我創建我的應用程序一個UIScrollView - 改編自此示例代碼:http://developer.apple.com/iphone/library/samplecode/Scrolling/Introduction/Intro.html的UIScrollView可點擊圖片iPhone
但我不知道如何使圖像點擊
任何建議嗎?
謝謝!
呀......「它們放在UIButtons」
//get the image to use, however you want
UIImage* image = [product.images objectAtIndex:i];
UIButton* button = [[UIButton alloc] init];
//set the button states you want the image to show up for
[button setImage:image forState:UIControlStateNormal];
[button setImage:image forState:UIControlStateHighlighted];
//create the touch event target, i am calling the 'productImagePressed' method
[button addTarget:self action:@selector(productImagePressed:)
forControlEvents:UIControlEventTouchUpInside];
//i set the tag to the image #, i was looking though an array of them
button.tag = i;
//add the new button w/ the image to your scrollview
[ImagesScroller addSubview:button];
[button release];
把它們放在UIButtons上。
形象沒有得到所有當我嘗試這種方法顯示 – Lilz 2010-08-11 08:19:58