2010-08-20 63 views

回答

2

只需創建一個視圖中所需的大小,添加一個UIImageView與它的底色圖像並添加按鈕

UIView *overlayView = [[UIView alloc] initWithFrame:aRect]; 
UIImageView *bgView =[[UIImageView alloc] initWithImage:[UIImage imageNamed:thePath]]; 
[overlayView addSubview:bgView]; 
[overayView addSubview:aButton]; 
[aButton release]; 
[bgView release]; 

未經檢驗

該代碼可以由UILongPressGestureRecognizer

執行