ios - Toggle UITextView scrollEnabled -
i initialized uitextview scrollenabled = true
. once set scrollenabled = false
, text view not scroll after i've set scrollenabled = true
is there way toggle textview's scrolling? have userinteractionenabled
set true
.
in
override func viewdidload() { view.addsubview(scrollview) scrollview.delegate = self scrollview.addsubview(textview) }
in
func scrollviewdidscroll(scrollview: uiscrollview) { if scrollview.contentoffset.y >= 180 { textview.scrollenabled = true // not work! } else { textview.scrollenabled = false // works! } }
i don't you,what trying. it's working me.just try below code.
- (ibaction)test:(id)sender { uibutton *btn = sender; switch (btn.tag) { case 0://enabled [customtextview setscrollenabled:yes]; break; case 1://disable [customtextview setscrollenabled:no]; break; default: break; } }
Comments
Post a Comment