[問題] 關於UITextView: 橫掃和文字捲動能並存嗎?
我正在寫一個app
在使用uitextview處理scroll和swipe時碰到一個難題
如果將uitextview的user interact關閉
當內容文字超過視窗時會無法使用捲動方式把下面的文字拉上來
但是把user interact開啟
uitextview會無法偵測手勢
已經有嘗試建立UITextview的subclsss
可是問題依然
當開啟user interact時
subclss中的以下程式碼無法被觸發
SwipableUITextview: UITextview {
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch* touch=[touches anyObject];
NSLog(@"touch begin in Textview: %@",
NSStringFromCGPoint([touch locationInView:self]));
//以上兩行是用來檢查事件是否有被觸發的程式碼
[super touchesBegan:touches withEvent:event];
[[self nextResponder] touchesBegan:touches withEvent:event];
}
請問有人知道如何讓uitextview可以捲動文字和偵測手勢的方法嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.57.84
→
10/02 03:38, , 1F
10/02 03:38, 1F
→
10/02 03:39, , 2F
10/02 03:39, 2F
→
10/02 13:13, , 3F
10/02 13:13, 3F
→
10/02 13:14, , 4F
10/02 13:14, 4F
→
10/02 13:14, , 5F
10/02 13:14, 5F
→
10/02 13:15, , 6F
10/02 13:15, 6F
→
10/02 13:15, , 7F
10/02 13:15, 7F
→
10/03 07:40, , 8F
10/03 07:40, 8F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章