我有一個自定義的UIRefreshControl「拉刷新」,出於某種原因,當我開始滾動時,視圖出現在所有其他視圖之上,而不是逐漸顯示自己,因爲滾動被拖下來。這就是我的意思:如何在我的視圖層次結構中調整UIRefreshControl的位置?
現在,我已經試圖通過使背景和色調的顏色在viewDidLoad中明確修補這件事:
var refreshControl: UIRefreshControl!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
refreshControl = UIRefreshControl()
refreshControl.backgroundColor = UIColor.clearColor()
refreshControl.tintColor = UIColor.clearColor()
collectionView?.addSubview(refreshControl)
}
雖然這並修復只是被貼滿了刷新的問題無論其透明度如何,refreshCont都是如此rol仍然位於我的視圖層次結構的頂部,您可以看到當我釋放滾動時,字母仍然懸在視圖上。雖然它確實隱藏了視圖,但當您開始拖動滾動時,它會非常快速地顯示再次認爲:
現在我甚至嘗試調用sendSubviewToBack
和insertSubview:aboveSubview:
方法,但他們沒有做任何事情..請記住,這是一個collectionViewController,而不是一個UIViewController與頂部的CollectionView ,所以我想沒有一個視圖後面的頂視圖,我可以發送一些東西到後面..但是有沒有我能實現的任何邏輯,將調整滾動開始時的意見界限?
當我添加它作爲一個子視圖到我的背景,它只是消失了,我的意思是控制的運動仍然存在,但其不可見 –
我可以設置RefreshControl的的backgroundColor應對和tintColor在viewDidLoad中清除以正確掩飾自己,但是我能做些什麼來突然拆分第二個毛刺,否則這個代碼會在滾動拖動開始時顯示出來? –
我能做些什麼來防止這種情況發生? –