0
我在VIEW上添加圖像動態,並在同一視圖我有3個按鈕。但是當我添加圖像時,他們顯示在這些按鈕上方,我可以將它們發回,但我有多個圖像,因此當我點擊一個圖像時,它會出現在前面,所以我可以與它進行交互(移動,旋轉)。添加UIView的按鈕,並使其透明,並啓用後面的觸摸視圖UIVIew
所以我做了什麼,我有我的主視圖添加圖像,我已添加childView我已添加按鈕,並使其透明。我可以看到按鈕後面的圖像,但不能與它們交互。
我必須使用此行,使之透明,我認爲這不是好辦法,使tranparent
ButtonsView.backgroundColor = [UIColor clearColor];
希望大家知道我想做的事情。
謝謝。讓我試試這個 – Zohaib
謝謝,我沒有實現touchesBegan。我剛纔在前面展示了我的圖片,然後在前面展示了我的按鈕。如果([b isKindOfClass:[UIButton class]]){[self.view bringSubviewToFront:b];} [self.view bringSubviewToFront:b]; } }將每個按鈕放在前面。謝謝 – Zohaib